Negative Zero?

H

Herbert

Sometimes when I subtract a number from itself, I get a negative zero, rather
than a simple zero. Why is this?
 
F

Fred Smith

It means that your result is less than zero, but not within the precision
you are displaying. For example, if the result is -0.00000000142, and your
number format is two decimal places, you will see -0.00. Subtracting a
number from itself often results in something other than true zero because
computers convert to binary to do computations. Binary conversions are not
perfect when extended to 15 decimal places.
 
H

Herbert

Fred Smith said:
It means that your result is less than zero, but not within the precision
you are displaying. For example, if the result is -0.00000000142, and your
number format is two decimal places, you will see -0.00. Subtracting a
number from itself often results in something other than true zero because
computers convert to binary to do computations. Binary conversions are not
perfect when extended to 15 decimal places.

--
Regards,
Fred
Please reply to newsgroup, not e-mail




Fred:
Thanks so much for your answer. It very well addresses my problem, and I am
grateful.

Best regards,
Herbert
 
Top