W3C home > Mailing lists > Public > public-qt-comments@w3.org > September 2006

[Bug 3759] [F+O] round-half-to-even and float precision

From: <bugzilla@wiggum.w3.org>
Date: Wed, 27 Sep 2006 22:55:30 +0000
CC:
To: public-qt-comments@w3.org
Message-Id: <E1GSiJO-0001J1-4e@wiggum.w3.org>

http://www.w3.org/Bugs/Public/show_bug.cgi?id=3759





------- Comment #2 from mike@saxonica.com  2006-09-27 22:55 -------
I'm not sure what do about it either. I'd like to be consistent with other
parts of the spec, but we are very strict about numeric precision in some
places, and very lax in other places. My own implementation of
round-half-to-even(xs:float) does the arithmetic in double precision, which I
think is reasonable but it's hard to argue that it's the only reasonable
approach - you still get rounding errors, but they are smaller than with float.

I think at this stage it's probably best to add a note saying that in the case
of xs:float and xs:double, the arithmetic used to implement round-half-to-even
may use floating point arithmetic, and that we don't prescribe the exact
algorithm which means that rounding errors may occur and are
implementation-dependent; the effect is that a number that is close to half-way
between two powers of ten may round either up or down. 
Received on Wednesday, 27 September 2006 22:55:33 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 16:57:15 UTC