ubjson / universal-binary-json

Community workspace for the Universal Binary JSON Specification.
116 stars 12 forks source link

Language for Endianness for storing float32 and float64 is not clear #79

Closed fangq closed 2 years ago

fangq commented 8 years ago

Two places have mentioned the endianness issues:

http://ubjson.org/type-reference/value-types/#numeric-byte-order-endianness

and

http://ubjson.org/#endian

the first link specifies explicitly that all integer types are stored in the Big-Endian format. However, for floats, the only language was "IEEE 754 compliant". However, AFAIK, IEEE 754 does not specify Endianness.

The second link does mention that all "numeral types" are stored in "Big Endian" format. However, it is very brief and nonspecific.

If the spec means to say that float32 and float64 should also be stored in the Big-Endian format, please say so explicitly in the "Byte Order / Endianness" section of the "type-reference" page.

Please clarify. thanks

Steve132 commented 4 years ago

I agree this is a problem with the current spec. I implemented it as big-endian.