-
-
Notifications
You must be signed in to change notification settings - Fork 1.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ties are rounded differently on c and js backends #9125
Comments
That's interesting that the JS spec calls that out directly:
Emphasis is theirs. |
Another rounding differenc: import strutils
echo formatFloat(2.5, ffDecimal, 0)) produces The |
* fix nim-lang#9125 * Update tests/stdlib/tmath.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * back Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
* fix nim-lang#9125 * Update tests/stdlib/tmath.nim Co-authored-by: Timothee Cour <timothee.cour2@gmail.com> * back Co-authored-by: Andreas Rumpf <rumpf_a@web.de> Co-authored-by: Timothee Cour <timothee.cour2@gmail.com>
On the c-like backends ties (values exactly between 2 adjacent integers) are rounded "away from zero".
On the js backend ties are rounded toward positive infinity.
produces
-2
on the c backend, but-1
on the js backend.The text was updated successfully, but these errors were encountered: