Originally Posted by
laserlight
Since one has to check if the range of integral values required can fit into the floating point variable in question on a given platform, I dont see why one cannot do a similiar check to ensure that a point where x+1 doesnt test non-equal to x is never reached.
Something along this line?
Code:
#include <stdio.h>
#include <float.h>
int main(void)
{
double a = DBL_MAX, b = DBL_MAX - 1;
printf("a = %g, b = %g\n", a, b);
return 0;
}
/* my output
a = 1.79769e+308, b = 1.79769e+308
*/