-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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
Floating point value decoded incorrectly by buf.readDoubleBE() #18208
Comments
/cc @bnoordhuis this is likely related to the recent switch to calculating this in JS. |
The offset was formerly coerced to a integer and this reimplements that. Fixes nodejs#18208
Here's another example: v9.4.0 (wrong):
v8.9.4 (correct):
edit: ok this seems to happen just because the |
also, probably the confusion comes from the fact that the examples in the docs actually pass |
The offset was formerly coerced to a integer and this reimplements that. PR-URL: #18215 Fixes: #18208 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
The offset was formerly coerced to a integer and this reimplements that. PR-URL: #18215 Fixes: #18208 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
The offset was formerly coerced to a integer and this reimplements that. PR-URL: nodejs#18215 Fixes: nodejs#18208 Reviewed-By: Anna Henningsen <anna@addaleax.net> Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl> Reviewed-By: Richard Lau <riclau@uk.ibm.com> Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Tobias Nießen <tniessen@tnie.de>
example_js.txt
The attached example produces the output:
246800 encodes to 410e208000000000
410e208000000000 decodes to 246800.03176522627
The expected result is:
246800 encodes to 410e208000000000
410e208000000000 decodes to 246800
The text was updated successfully, but these errors were encountered: