十进制、双精度、整数等数据类型的范围?
Range of decimal, double, integer, etc. data types?
XML 和 RDF 数据具有某些数据类型,如十进制、双精度和整数 (http://www.w3.org/TR/1999/WD-xmlschema-2-19991217/#decimal)。这些数据类型的范围是多少。
我知道 C++ 中十进制、双精度、整数的范围在 https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx 中给出。 XML 和 RDF 数据类型是否具有相同的范围或者是它们的范围。如果它们的范围不同那么它们的实际范围是多少?
xs:double 和 xs:float 由 IEEE 规则定义。参见
3.3.5 double
The ·value space· of double contains the non-zero numbers m × 2e ,
where m is an integer whose absolute value is less than 253, and e is
an integer between −1074 and 971, inclusive.
相比之下,xs:integer 和 xs:decimal 的限制是实现定义的。
Section 3.3.3: [Definition:] decimal represents a subset of the real
numbers, which can be represented by decimal numerals. The ·value
space· of decimal is the set of numbers that can be obtained by
dividing an integer by a non-negative power of ten, i.e., expressible
as i / 10n where i and n are integers and n ≥ 0.
Section 5.4: All ·minimally conforming· processors must support
decimal values whose absolute value can be expressed as i / 10^k,
where i and k are nonnegative integers such that i < 1016 and k ≤ 16
(i.e., those expressible with sixteen total digits).
XML 和 RDF 数据具有某些数据类型,如十进制、双精度和整数 (http://www.w3.org/TR/1999/WD-xmlschema-2-19991217/#decimal)。这些数据类型的范围是多少。
我知道 C++ 中十进制、双精度、整数的范围在 https://msdn.microsoft.com/en-us/library/s3f49ktz.aspx 中给出。 XML 和 RDF 数据类型是否具有相同的范围或者是它们的范围。如果它们的范围不同那么它们的实际范围是多少?
xs:double 和 xs:float 由 IEEE 规则定义。参见
3.3.5 double
The ·value space· of double contains the non-zero numbers m × 2e , where m is an integer whose absolute value is less than 253, and e is an integer between −1074 and 971, inclusive.
相比之下,xs:integer 和 xs:decimal 的限制是实现定义的。
Section 3.3.3: [Definition:] decimal represents a subset of the real numbers, which can be represented by decimal numerals. The ·value space· of decimal is the set of numbers that can be obtained by dividing an integer by a non-negative power of ten, i.e., expressible as i / 10n where i and n are integers and n ≥ 0.
Section 5.4: All ·minimally conforming· processors must support decimal values whose absolute value can be expressed as i / 10^k, where i and k are nonnegative integers such that i < 1016 and k ≤ 16 (i.e., those expressible with sixteen total digits).