On Mar 12, 7:20 am, Piet van Oostrum <[EMAIL PROTECTED]> wrote:
> But if the answer is incorrect (in the float calculation) the error is
> limited. IEEE 754 prescribes that the error should be at most 1 LSB, IIRC.
> And then the number of errors is the proper measure.

There are two operations here, both of which can introduce error of
up to 0.5 ulp (ulp = unit in the last place).  Moreover, the second
operation (the multiplication) can magnify the error introduced by
the first (the division).

You're correct that for IEEE 754 binary floating-point arithmetic,
(x/y)*y and x will either be equal or differ by exactly 1ulp (except
perhaps in rarely-occurring corner cases).  But for decimal numbers,
(x/y)*y and x could be as much as 5 ulps apart.

Mark


> --
> Piet van Oostrum <[EMAIL PROTECTED]>
> URL:http://pietvanoostrum.com[PGP 8DAE142BE17999C4]
> Private email: [EMAIL PROTECTED]

-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to