Skip to content

Comparison functions behave incorrectly for integers larger than 2^53 #678

@cmrschwarz

Description

@cmrschwarz

Some of the new comparison helper functions (specifically lt,gt, lte and gte) convert all numbers to f64 before comparing them.

This leads to integers larger than 2^53 (f64 floating point mantissa is 52 bits + leading one) behaving incorrectly.

This is a breaking change from the pre-6.1 behavior, where these functions only accepted integers (and therefore handled them correctly).

Here's a simple reproduction of the issue:

{{#if (lt 9007199254740992 9007199254740993)}}
This should be displayed, but isn't.
{{/if}}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions