Skip to content

Documentation for @round states incorrect rounding mode #9551

@jmoorman

Description

@jmoorman

The documentation for @round states

Rounds the given floating point number to an integer, away from zero. Uses a dedicated hardware instruction when available.

This language implies that is an exact opposite of @trunc which states:

Rounds the given floating point number to an integer, towards zero. Uses a dedicated hardware instruction when available.

But this is not the case. The actual rounding mode being used by @round is rounding to the nearest integer with "round half away from zero" as a tiebreaker.
https://en.wikipedia.org/wiki/Rounding#Round_half_away_from_zero

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions