google / cel-spec

Common Expression Language -- specification and binary representation
https://cel.dev
Apache License 2.0
2.78k stars 222 forks source link

Extension functions for rounding #193

Open JimLarson opened 3 years ago

JimLarson commented 3 years ago

PR #192 corrects the spec to match the implementations by doing floating point to integer conversion via truncation (round towards zero). Other rounding behaviors are sometimes useful.

Create an extension library for mathematics, e.g. math.*(), with at least the following functions:

More behaviors are possible if needed, though this seems unlikely. See https://en.wikipedia.org/wiki/Rounding