Sometimes when I subtract a number from itself, I get a negative zero, rather
than a simple zero. Why is this?
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
--
Don Guillett
SalesAid Software
donaldb@281.com
"Herbert" <Herbert@discussions.microsoft.com> wrote in message
news:9517F5D9-3A15-4A97-93E1-B442A948E3E0@microsoft.com...
> Sometimes when I subtract a number from itself, I get a negative zero,
rather
> than a simple zero. Why is this?
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
"Herbert" <Herbert@discussions.microsoft.com> wrote in message
news:9517F5D9-3A15-4A97-93E1-B442A948E3E0@microsoft.com...
> Sometimes when I subtract a number from itself, I get a negative zero,
> rather
> than a simple zero. Why is this?
"Fred Smith" wrote:
> 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
>
>
> "Herbert" <Herbert@discussions.microsoft.com> wrote in message
> news:9517F5D9-3A15-4A97-93E1-B442A948E3E0@microsoft.com...
> > Sometimes when I subtract a number from itself, I get a negative zero,
> > rather
> > than a simple zero. Why is this?
>
> Fred:
Thanks so much for your answer. It very well addresses my problem, and I am
grateful.
Best regards,
Herbert
>
There are currently 1 users browsing this thread. (0 members and 1 guests)
Bookmarks