diff options
author | alandonovan <adonovan@google.com> | 2020-11-11 12:03:41 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-11 12:03:41 -0500 |
commit | 3b7e02ecde8b80808c06c8284ce9f85c101fcebd (patch) | |
tree | 1168e8456ab49c55ff2f47c9b98a7a0feff69204 /starlarkstruct | |
parent | dff0ae5b48201537496c261571cf1f08725ec804 (diff) | |
download | starlark-go-3b7e02ecde8b80808c06c8284ce9f85c101fcebd.tar.gz |
starlark: bring floating-point into spec compliance (#313)
This change makes go.starlark.net's floating-point implementation
match the proposed spec (see https://github.com/bazelbuild/starlark/pull/119),
and thus much more closely match the behavior of the Java implementation.
The major changes are:
- Float values are totally ordered; NaN compares greater than +Inf.
- The string form of a finite float value always contains an exponent
or a decimal point, so they are self-evidently not int values.
- Operations that would cause a large integer to become rounded to
an infinite float are now an error.
The resolve.AllowFloat boolean, and the corresponding -float command-line
flag, now have no effect. Floating point support is always enabled.
Diffstat (limited to 'starlarkstruct')
-rw-r--r-- | starlarkstruct/struct_test.go | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/starlarkstruct/struct_test.go b/starlarkstruct/struct_test.go index 8e6a93d..5de7020 100644 --- a/starlarkstruct/struct_test.go +++ b/starlarkstruct/struct_test.go @@ -19,7 +19,6 @@ func init() { // The tests make extensive use of these not-yet-standard features. resolve.AllowLambda = true resolve.AllowNestedDef = true - resolve.AllowFloat = true resolve.AllowSet = true } |