Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

[BUG] math.round incorrectly uses HALF_EVEN instead of HALF_UP #1055

Copy link
Copy link

Description

@rayokota
Issue body actions

Describe the bug
math.round uses HALF_EVEN (banker's rounding) internally, but cel-java's own function declaration, cel-go's reference implementation, and cel-cpp's reference implementation all specify "ties round away from zero". cel-java is the outlier among the three official reference clients; math.round should instead use HALF_UP

To Reproduce
Check which components this affects:

  • parser
  • checker
  • runtime

Sample expression and input that reproduces the issue:

// sample expression string
math.round(42.5) == 42.0 // should be 43.0

Fix is at #1054

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      Morty Proxy This is a proxified and sanitized view of the page, visit original site.