Type Conversion in Odin

Table of Contents

1. Bit Cast

Bit cast is like reinterpret_cast<> in C++. Its job is to conduct type conversion without changing the bit representation.

main :: proc() {
  f := f32(132)
  u := transmute(u32) f // <<<

  fmt.printfln("f: f32 = {}, transmute(u32)f = {}", f, u)
  // f: f32 = 132, transmute(u32)f = 1124335616
}

Date: 2026-10-21 Wed

Author: ArcaLunar