[SDL] Portable float packing/unpacking.

Ryan C. Gordon icculus at icculus.org
Sun Feb 12 23:58:07 PST 2006


> Be really careful with this.  Optimizing compilers will sometimes keep
> floating point values in the floating point stack, so *(uint32*)&f will
> be garbage in this case.

Unions and the "volatile" keyword are your friends here.

--ryan.






More information about the SDL mailing list