[Bug 2735] Need for exact semantics in casting string to decimal

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





------- Comment #2 from chamberl@almaden.ibm.com  2006-03-14 22:51 -------
Based on working group discussions, I submit the following revised proposal:

In F&O Section 17.1.1 (Casting from xs:string and xs:untypedAtomic), add the
following new paragraph following paragraph 6:

In casting to xs:decimal or to a type derived from xs:decimal, if the value is
not too large or too small but nevertheless cannot be represented accurately
with the number of decimal digits available to the implementation, the
implementation may round to the nearest representable value or may raise a
dynamic error [err:FOCA0006]. The choice between rounding and error behavior is
implementation-defined.

In addition, add the following new error code to Appendix C:

err:FOCA0006, String cast to decimal has too many digits of precision.

In addition, add the following new item to the list of implementation-defined
features in Appendix G:

The result of casting a string to xs:decimal, when the resulting value is not
too large or too small but nevertheless has too many decimal digits to be
accurately represented, is implementation-defined. See Section 17.1.1.

Received on Tuesday, 14 March 2006 22:51:28 UTC