ipld / specs

Content-addressed, authenticated, immutable data structures
Other
592 stars 108 forks source link

dag-cbor: resolve the float question - 64-bit #311

Closed rvagg closed 3 years ago

rvagg commented 3 years ago

(PR on a PR, apologies)

Let's resolve this! I think we're all coming around to the always-64-bit representation being the appropriate course of action. It's both easier and most likely to be safest over time. It can be wasteful for some common numbers, but I suspect the Venn diagram of people concerned about byte shaving and those wanting floats in their blocks might have a very small intersecting area.

rvagg commented 3 years ago

done, pushed fixup at 764c992:

DAG-CBOR encodes all floating point numbers as the binary form of double-precision floats (64-bit IEEE 754); i.e. as major type 7, minor 27.