I made a union to convert between int bits and floats, but the values are coming out wrong sometimes. This is working without issue in other languages so I'm really stumped. Here's an example:

union test { int i; float f; }
test t = { i : 0x7fb00000};
float t2 = t.f;//int bits 0x7fb00000 as float
test t3 = { f : t2 };
writefln("%x", t3.i);//prints 7ff00000 NOT 0x7fb00000

Reply via email to