I have to use bit/integer ops to figure out the epsilon for a given value in C. I know in terms of bit patterns that computing the next neighbor involves incrementing the mantissa, and if that overflows, to increment the exponent - but I'm not sure where to begin in terms of calculating the epsilon.
I can't use floating point math - so I need to generate the bit pattern directly. This makes it trickier because I cannot subtract.
Here's my understanding (based on some research I've done here on SO): the range changes obviously as the numbers get bigger, but I'm not sure how to use FLT_EPSILON
to generate the right numbers. For 2^2x numbers, perhaps it is (FLT_EPSILON - 1) * number
?