Archive for March 11th, 2008

Floating point voodoo #1

Tuesday, March 11th, 2008

This is kind of cool:

float Lifetime = FLT_MAX;  // Use FLT_MAX for “infinite lifetime”
Lifetime -= 1.0f;                // Or elapsed time or whatever, small value

=> the IEEE float machinery is such that “Lifetime” doesn’t change in this case. So an infinite lifetime is really infinite, automagically :)

shopfr.org cialis