Skip to content

Add fractional float cases at the int64/uint64 boundaries #430

Open

Description

@toddbaert

Per the ADR, whole floats in [-2^63, 2^64-1] must be normalized to CBOR integers before hashing. The "Fractional operator with floats limits" scenario doesn't cover the edges of that range; we've found bugs at these boundaries in several implementations that the suite didn't catch.

Suggested Float rows (buckets computed with the Go reference, including the fix in open-feature/flagd#2011):

hashing_input Expected encoding value
-9223372036854775808.0 (-2^63) int64 bucket3
9223372036854775808.0 (2^63) uint64 bucket16
1e19 uint64 bucket14
18446744073709549568.0 (largest double < 2^64) uint64 bucket16
18446744073709551616.0 (2^64) float bucket15

Activity

  1. toddbaert commented on Oct 7, 2026

    @toddbaert
    MemberAuthor
  2. m-olko commented on Oct 8, 2026

    @m-olko

    At the beginning we wanted to add much more tests around those limits, not only float but also ints, but we had issues when trying to use integers in this range due to the differences between languages parsing json structures. Because of that we dropped this idea for now, until unification of handling numbers in the [2^53, 2^63] happens. This addition by limiting to only float makes a lot of sense. Thanks!

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions