Math returns a cel.EnvOption to configure namespaced math helper macros and functions. Note, all macros use the 'math' namespace; however, at the time of macro expansion the namespace looks just like any other identifier. If you are currently using a variable named 'math', the macro will likely wor
(options ...MathOption)
| 343 | // math.sqrt(985.25) // returns 31.388692231439016 |
| 344 | // math.sqrt(-15) // returns NaN |
| 345 | func Math(options ...MathOption) cel.EnvOption { |
| 346 | m := &mathLib{version: math.MaxUint32} |
| 347 | for _, o := range options { |
| 348 | m = o(m) |
| 349 | } |
| 350 | return cel.Lib(m) |
| 351 | } |
| 352 | |
| 353 | const ( |
| 354 | mathNamespace = "math" |