# Why @bitCast reverses bits when casting type to array?

**URL:** <https://ziggit.dev/t/why-bitcast-reverses-bits-when-casting-type-to-array/17697>\
**Category:** Explain\
**Tags:** language, compiler\
**Created:** [September 24, 2026, 2:18pm UTC](https://ziggit.dev/t/why-bitcast-reverses-bits-when-casting-type-to-array/17697 "2026-09-24T14:18:39Z")\
**Posts on this page:** 1\
**Showing post:** 3

<div class="post-metadata">

**Author:** ![Calder-Ty](https://ziggit.dev/user_avatar/ziggit.dev/calder-ty/32/10237_2.png) [@Calder-Ty](https://ziggit.dev/u/Calder-Ty)\
**Post date:** [September 24, 2026, 2:49pm UTC](https://ziggit.dev/t/why-bitcast-reverses-bits-when-casting-type-to-array/17697/3 "2026-09-24T14:49:27Z")

</div>

[Devlog ⚡ New @bitCast Semantics and LLVM Backend Improvements](https://ziggit.dev/t/devlog-new-bitcast-semantics-and-llvm-backend-improvements/16336)

> Every type which supports `@bitCast` has a “logical bit layout”—a representation of that type as an ordered sequence of bits. For instance, `u5` is composed of 5 logical bits, which we order from least-significant to most-significant.

EDIT:  
Just to add more context, this is a new change (i.e part of 0.17.0), and the whole article is worth looking into and reading.

---

_[View the full topic](https://ziggit.dev/t/why-bitcast-reverses-bits-when-casting-type-to-array/17697)._
