google / starlark-go

Starlark in Go: the Starlark configuration language, implemented in Go
BSD 3-Clause "New" or "Revised" License
2.31k stars 210 forks source link

starlarktest/assert.star: allow +/-1 ULP in float eq comparisons #490

Closed adonovan closed 1 year ago

adonovan commented 1 year ago

Fixes #488

adonovan commented 1 year ago

I'm actually surprised trig operations get within 1 ULP of accuracy. I remember that not being the case for JavaScript.

Yeah, I was being optimistic. I may need to relax the check later, but the issue reported here was off by exactly 1 ULP.