Skip to content

Floating point example is the wrong way aroundΒ #28

@dan-robertson

Description

@dan-robertson

The example in the specification is for the float 29.9510, whose bits are 0x41ef9ba6. Jackson serializes this as [0x28] 0x04 0x0f 0x3e 0x37 0x26 (the 0x28 is the tag for a 32-bit float). The specification gives these bytes in the opposite order.

Here is the code of the jackson serializer for reference: f64 f32.

For completeness, the double precision float for -29.9510 has binary representation 0xc03df374bc6a7efa and is thus serialized as [0x29] 0x01 0x40 0x1e 0x7c 0x6e 0x4b 0x63 0x29 0x7d 0x7a.

Metadata

Metadata

Assignees

No one assigned

    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