New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
One presentation, two values. #1
Comments
The suggestion here is to simply extend the lexical space of Your are right, this might get confusing when
And that's why, IMO, we should make |
I don't think you can ignore the effect on arithmetic and F&O. In going to the XSD community, there is a lot of work/history to consider. What might be seen here as non-breaking changes maybe viewed differently elsewhere. XSD already has precisionDecimal so need to understand why it is not a primitive type (XSD terminology) - why does decimal not derive from precisonDecimal? The original motivation is JSON-LD. The change here no longer solves that issue (1E400, NaN). For JSOn-LD the target needs to be the overlap of xsd:double and xsd:decimal (51 bit precision, no NaN, INF). Otherwise, there was one issue and now there are two :-) xsd:decimal also has a precision requirement - at least 16 digits in XSD 1.1 (it was 18 in 1.0 - they reduced it - why?). |
Due to the silence, I'll make a comment.
This matter has arisen because of number handling in JSON-LD.
On w3c/dxwg#1536 (comment) @dbooth discuss the fact precision can mean that decimals and doubles are not the same. It's worse than David points out - integer values that can be represented by xsd:doubles jump in 2's at the end of the ranges.
But scale is also important.
1E400
is a legal xsd:precisionDecimal.But as an xsd:double it is value +INF. But but xsd:precisionDecimal also has +INF which is different!
So what is
1E400 + 0
? You can't ignore arithmetic on numbers in the definition of the datatype.The same representation (lexical form) in the two interpretations give different answers (value space - the number line extended with +INF, -INF and NaN).
xsd:double and xsd:float are separate primitive datatype in XSD.
xsd:integer is not primitive; it is a derived type of xsd:decimal. For xsd:decimal/xs:integer a legal representation is same value on the number line.
xsd:double/xsd:float are not well-behaved numbers.
The text was updated successfully, but these errors were encountered: