S
Siemel Naran
About inaccurate floating point and DBL_MAX.
double x = 2;
double y = 1 + 1;
assert(x == y);
Because of inaccurate floating point representation, x and y may not be
equal (ie. they may differ by 0.0000000001 or some small number) on some
implementations.
But how about DBL_MAX?
double x = DBL_MAX;
f(x);
assert(x != DBL_MAX);
Is this above comparison exact, or should we say assert(x < DBL_MAX).
Thanks.
double x = 2;
double y = 1 + 1;
assert(x == y);
Because of inaccurate floating point representation, x and y may not be
equal (ie. they may differ by 0.0000000001 or some small number) on some
implementations.
But how about DBL_MAX?
double x = DBL_MAX;
f(x);
assert(x != DBL_MAX);
Is this above comparison exact, or should we say assert(x < DBL_MAX).
Thanks.