-
Notifications
You must be signed in to change notification settings - Fork 228
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Convert double to integer via truncation. #192
Conversation
Matches behavior of C, Go, and Java. Introduce a round() function for round-half-away like GoogleSQL.
doc/langdef.md
Outdated
@@ -2070,7 +2070,8 @@ See [cel-go/issues/9](https://github.com/google/cel-go/issues/9). | |||
(double) -> int | |||
</td> | |||
<td> | |||
type conversion | |||
Type conversion. Rounds toward zero, then errors if result is out of | |||
range. See also round(). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's introduce round
, floor
, and ceil
into a math
namespace in a separate PR.
e.g. math.round(double)
, etc.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
Defer round() until another PR.
PTAL |
Filed Issue #193 as a reminder to implement the math extension library with alternate ways of rounding. |
Convert double to integer via truncation. (google#192)
Matches behavior of C, Go, and Java.
Introduce a round() function for round-half-away like GoogleSQL.
Fixes #191