Skip to content

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

@rayokota

Description

@rayokota

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

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