Thanks for all having commented my question. It pushed me on the right track:
Adding 0.0 to -0.0 gives the result 0.0. Adding 0.0 to anything else has no effect. To say it in other words, adding 0.0 to a value will not change the value unless the value was -0.0 in which case the result will be 0.0.
This article explain that in IEEE 754 binary floating-point numbers, zero is a signed quantity. You can have -0.0 and +0.0.
The C source code makes a lot of efforts to preserve precision in floating point operation and for that purpose must take care of negative zero.
I checked that MSVC and Delphi handle floating point values (double data type) exactly the same way and so I simply have to exactly translate the C-code to Delphi and it works the same in both languages.
-0
. I guess it is a way to insure values are not equal to-0
. Certainly no longer needed – Damien Jan 27 at 7:33