View Single Post
  #5   Report Post  
Posted to microsoft.public.excel.misc
Jerry W. Lewis
 
Posts: n/a
Default Extra 1 showing up in 15th decimal place

5.321299999999999918998128123348578810691833496093 75
-5.1173000000000001818989403545856475830078125
-----------------------------------------------------
0.203999999999999737099187768762931227684020996093 75

You might find my functions at
http://groups.google.com/group/micro...fb95785d1eaff5
to be helpful.

Jerry

nsc wrote:

Thanks for the replies concerning the IEE 754 standard. A quick look and
it sort of makes sense to me. Where it doesn't make sense is with
another set of numbers. 5.3213 minus 5.1173 (note, the decimal numbers
are the same as my initial post) works fine in the same circumstances.
I would think that if 9.3213 and 9.1173 have binary approximations as
Mr. Lewis posted, wouldn't the other pair of numbers have the same
approximation? (this is also true if you replace the 5 with a 2, but if
you replace it with a 13 it again has the unexpected outcome)

I actually have a total of 40 pairs of numbers in my spreadsheet. They
all should subtract to .204, and they do. 26 of these pairs end up with
this binary approximation error.

Thanks again.