[Bf-committers] Verse 2005 Errors
Emil Brink
emil at obsession.se
Fri Sep 15 08:37:01 CEST 2006
Branan Riley wrote:
> # define SET_TO_MAX_FLOAT(x) *((unsigned*)(&x)) = 0x7f7fffff
Yeah, that (give or take a few parenthesis), is what I've come up with as
well, but currently the definitions in the public verse.h header are:
#define V_REAL64_MAX 1.7976931348623158e+308
#define V_REAL32_MAX 3.40282347e+38F
So, unless we want to change the interface, we really need a constant that
can be directly assigned to a floating point variable. Likewise, we need
the constant to be available for direct comparisons against variables.
Right now, I guess I'll try and get hold of the trouble-making Microsoft
compiler (it's on a laptop currently used by my boss, I think), and try
the adjusted literal values on that. The literals I've come up with so far
are 3.4028235e+38f and 1.7976931348623157e+308, respectively. It is my
hope that using these results in the wanted bit patterns, and should do so
on all IEEE 754 systems. But I need to test it. Feel free to tell me if it
works out on your system, and which compiler(s) you tried it with, if you
have the inclination.
Thanks for your input. Regards,
/Emil
More information about the Bf-committers
mailing list