You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
OPA currently uses float64 as the underlying number representation in storage and the AST. Float64 was used initially because this is the default return type for numbers in encoding/json. Unfortunately this leads to loss of precision when dealing with large int64 values.
One solution would be to switch to json.Number (string) as the underlying representation.
The text was updated successfully, but these errors were encountered:
These changes modify OPA to use json.Number to represent number values in
storage and the AST. Comparisons and numeric operations are handled by the
math/big package. Using json.Number avoids loss of precision when loading
integers greater than 2**53 and use of math/big avoids need for type
conversions in the built-in implementations. In the long run, the math/big
usage may be replaced with specific paths for smaller numbers.
Fixesopen-policy-agent#154
OPA currently uses float64 as the underlying number representation in storage and the AST. Float64 was used initially because this is the default return type for numbers in
encoding/json
. Unfortunately this leads to loss of precision when dealing with large int64 values.One solution would be to switch to json.Number (string) as the underlying representation.
The text was updated successfully, but these errors were encountered: