Skip to content

feature: Add support for encoding Go float64 and float32 to shortest form of CBOR integer (dCBOR) #632

Description

@bumblefudge

Is your feature request related to a problem? Please describe.
In section 2.3 of the dCBOR application profile that the CBOR WG has been iterating the last 2 years, there is a more extreme numeric reduction of floats, not just from float32 > float16, but from either to int anywhere that an int is semantically identical.

Describe the solution you'd like
Would it be possible to refactor ShortestFloatMode to have int as one of the options, or is this a huge lift?

Describe alternatives you've considered
Alternately, in my use-case, the approach in #623 might work, defining some kind of FloatOrInt in the JSON<>CBOR rules for Floats that might get Int'd in dCBOR...

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dCBORwaiting-for-specsWaiting for draft-RFC or specs to be updated

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions