Skip to content

Using the smallest floating point representation #9

@windelbouwman

Description

@windelbouwman

Hi!

Good to see some action in rust cbor space! Thank you for your efforts.

I have a question regarding the attempt to use the smallest possible datatype to represent the floating point value. For integer values, I'm 100% convinced this is a good idea. For floating point values, I have my doubts, let me list my thoughts:

  • floating point is always tricky, there is nan, inf, +inf. There exists signalling NaN and quiet NaN. Is this all handled correctly when shrinking to a smaller floating point type?
  • Is the automatic shrinking compatible with other languages? Does the shrinking of the floating point value, based upon it's value, play nice with other languages which use cbor? How do other implementations of cbor deserialization react when a field is sometimes encoded as f64 and sometimes as f32?

I tried to reproduce the issue I faced, I'll give it another shot. It's still located here: pyfisch/cbor#169

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions