c++ - 十进制、 double 、整数等数据类型的范围?

标签 c++ xml rdf

XML 和 RDF 数据具有某些数据类型,如十进制、 double 和整数 (http://www.w3.org/TR/1999/WD-xmlschema-2-19991217/#decimal)。这些数据类型的范围是什么。

我知道 C++ 中十进制、 double 、整数的范围在 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).

关于c++ - 十进制、 double 、整数等数据类型的范围?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29582645/

相关文章:

php - 在 Javascript 中解析一个单独的 PHP 数组

xml - UPS API 针对美国国家/地区抛出 "Invalid Shipment content Value"错误

python - 在 .svg xml 中按 ID 选择元素

rdf - 导入 RDF : are referenced blank nodes gonna be merged or handled separately?

rdf - 可以执行这些类型的 SPARQL 查询吗?

uri - RDF 中使用的 URI 中是否允许使用 "query string"?

c++ - 如何使 2 = .01 和 .01 = 2?

c++ - 当有足够的可用 RAM 时使用交换。性能受影响

c++ - (.bss+0x0) : multiple definition of Proxies

c++ - 如果我在每个平台上使用相同的种子,随机结果会相同吗?