Files
releases/test/scheduler
Torin Sandall 0c2d3ab992 topdown: Fix loss of precision in arithmetic and aggregate builtins
The the arithmetic and aggregate builtin functions make use of
builtins.FloatToNumber to convert big floats back into AST number
values for returning to the evaluator. Previously the
builtins.FloatToNumber function used big.Float#String to perform the
conversion--however, this function sets the default precision to 10
which causes loss of precision. The fix simply updates the helper
function to use big.Float#Text instead and set precision to -1 which
uses as many places as necessary. In future, we may want to give users
control over precision to aid in situations where clients cannot deal
with large JSON numbers.

Fixes #2469

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-06-15 15:58:56 -04:00
..