Negative Zero?

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Sometimes when I subtract a number from itself, I get a negative zero, rather
than a simple zero. Why is this?
 
probably a small diff somewhere in the 15 digits of the number
 
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.
 
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top