Skip to content

core: say how a number from the input or params that a 64-bit float can't hold is reported #89

Open

Description

@jbpros

#87 makes a check fail when the policy holds a number that a 64-bit float can't hold, because JavaScript reads 1e400 as Infinity and 1e-400 as 0, and the same check could pass there and fail with OPA. Numbers in the input aren't covered, and neither are numbers read from $$params with a ref.

OPA keeps them exactly, so a row's inputs shows {"name": "n", "value": 1e400}, and equals against 1e400 in the input compares exactly. An implementation in JavaScript would read the input as Infinity, write it as null in the report, and could compare it differently.

The same goes for a ref to $$params that reads 1e400. ergo doesn't control the input or the params, so failing the check might not be right. Options:

  • fail any check that reads such a number, with its own cause
  • leave it and say in REFERENCE.md that reports only match across implementations for inputs whose numbers fit a 64-bit float

🤖 Generated with Claude Code

Activity

  1. added
    coreRelates to the ergo library or format themselves.
    impacts-ergo-reportsImpacts ergo report schema. Careful design attention needed.
    on Oct 2, 2026
  2. changed the title [-]core: say how a number in the input that a 64-bit float can't hold is reported[/-] [+]core: say how a number from the input or params that a 64-bit float can't hold is reported[/+] on Oct 2, 2026
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

    coreRelates to the ergo library or format themselves.impacts-ergo-reportsImpacts ergo report schema. Careful design attention needed.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions