Skip to content

Small numbers are rounded to zero on calculation #2685

@itchyny

Description

@itchyny

Describe the bug
In the latest version of jq, jq -n '1 / 1e-17' exits with Division by zero error, but should emit 1e+17.

To Reproduce
Run jq -n '1 / 1e-17'.

Expected behavior
Since 1e-17 is not small enough to be rounded to zero, 1e+17 is expected, just like jq 1.6.

Environment (please complete the following information):

  • Both macOS, Ubuntu (on Docker).
  • jq version: jq-1.6-250-gce3701f

Additional context
Likely a regression of cf4b48c.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions