I was always assuming that the following test will always succeed for finite values (no INF, no NAN) of somefloat
:
assert(somefloat*0.0==0.0);
In Multiply by 0 optimization it was stated that double a=0.0
and double a=-0.0
are not strictly speaking the same thing.
So I was wondering whether this can lead to problems on some platforms e.g. can the result of the above test depend on a
beeing positive or negative.