It depends on the language. In a language like Rust, direct casts mean &quot;reinterpret these bits&quot;, and the two are represented differently, so that wouldn&#x27;t work. In a less low-level language, then sure, maybe a cast would work for this case. I&#x27;m not sure that it&#x27;s any more verbose or scary looking, though.