No, here is a trivial example of a counter doublewith floating point precision:
double x = 4.9E-324;
double y = x * 0.5;
bool test = y + y == x;
Floating-point numbers in IEEE-754 have limited accuracy, and we may lose information when divided by 2. In most cases, when you decrease the number, you get accuracy, you can reduce the exponent, but, as above, this is not always enough. Sometimes you cannot reduce the exponent.
Anything that has a minimal exponent and an odd mantissa will not contain equality. Such an example x = 5.0E-322.
source
share