-
-
Notifications
You must be signed in to change notification settings - Fork 239
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
Writing NaN differs from nodejs Buffer #197
Comments
Don't use Use
Wait, |
Oops. I should have been using Unfortunately, even after swapping out the new for alloc, the results are still different between Buffer implementations. |
To test this properly, use var B = require('buffer/').Buffer
var assert = require('assert')
var b1 = B.alloc(8)
b1.writeDoubleLE(NaN, 0)
var b2 = Buffer.alloc(8)
b2.writeDoubleLE(NaN, 0)
assert.deepEqual(b1, b2) This is probably related to #177. Eventually, we'll get all the Node.js tests passing again and get back in sync. (There are changes to |
@geastwood Thank you for digging into this and finding the root cause. I left a comment on your PR. |
Hello,
I was recently attempting to swap out nodejs' Buffer with this one on a fork of another project, so I could use it in a non-node environment, when I noticed an inconsistency between nodejs' Buffer and this library when dealing with
NaN
Here's a sample (using most recent npm install of 'buffer'):
in node 6.x, 8.x, and 9.x, the resulting buffer objects are different
Node's (native) Buffer:
00 00 00 00 00 00 f8 7f
buffer library's Buffer:
01 00 00 00 00 00 f0 7f
- bytes 0 and 6 are differentThat's probably not supposed to happen, right?
The text was updated successfully, but these errors were encountered: