Hi. In units.ttl, constants.ttl, prefixes.ttl there are some numbers with the datatype xsd:float. The accuracy of the values intended to represent is impaired by the use of xsd:float, as by definition the semantically represented value is a value, that can be represented with a IEEE 754 32 bit binary floating point number. Literals with lexical representations that do not exactly match a 32 bit binary floating point number are rounded. Following, the lexical representation suggests an accuracy that is not given. For example,
"1e-06"^^xsd:float represents 0.0000009999999974752427078783512115478515625,
"1e+30"^^xsd:float represents 1.000000015047466219876689E+30, or
"0.0174532925199433"^^xsd:float represents 0.01745329238474369049072265625.
For xsd:float, only the first 7 digits are guaranteed (16 digits in case of xsd:double). Instead, xsd:decimal should be used, as it preserves arbitrary precision. xsd:decimal has the disadvantage to not permit exponential notation. But I think, preserving the accuracy of the numbers is of highest importance for the SI Reference Point, so this disadvantage is acceptable. Using xsd:decimal would also permit to use Turtle shorthand syntax for decimal numbers. Further, as xsd:integer is a subtype of xsd:decimal properties with Integer and Decimal Number values, could get the rdfs:range xsd:decimal, in contrast to xsd:float and xsd:integer that are not in a subtype relation to each other.
Related issue: #24 (@stuchalk), #59
Detailed discussion of the problem: https://doi.org/10.1007/978-3-031-06981-9_10
Hi. In
units.ttl,constants.ttl,prefixes.ttlthere are some numbers with the datatypexsd:float. The accuracy of the values intended to represent is impaired by the use ofxsd:float, as by definition the semantically represented value is a value, that can be represented with a IEEE 754 32 bit binary floating point number. Literals with lexical representations that do not exactly match a 32 bit binary floating point number are rounded. Following, the lexical representation suggests an accuracy that is not given. For example,"1e-06"^^xsd:floatrepresents 0.0000009999999974752427078783512115478515625,"1e+30"^^xsd:floatrepresents 1.000000015047466219876689E+30, or"0.0174532925199433"^^xsd:floatrepresents 0.01745329238474369049072265625.For
xsd:float, only the first 7 digits are guaranteed (16 digits in case ofxsd:double). Instead,xsd:decimalshould be used, as it preserves arbitrary precision.xsd:decimalhas the disadvantage to not permit exponential notation. But I think, preserving the accuracy of the numbers is of highest importance for the SI Reference Point, so this disadvantage is acceptable. Usingxsd:decimalwould also permit to use Turtle shorthand syntax for decimal numbers. Further, asxsd:integeris a subtype ofxsd:decimalproperties with Integer and Decimal Number values, could get therdfs:range xsd:decimal, in contrast toxsd:floatandxsd:integerthat are not in a subtype relation to each other.Related issue: #24 (@stuchalk), #59
Detailed discussion of the problem: https://doi.org/10.1007/978-3-031-06981-9_10