Skip to content

'f' float unpack fix#2

Open
onip wants to merge 2 commits intorauls:masterfrom
onip:float_fix
Open

'f' float unpack fix#2
onip wants to merge 2 commits intorauls:masterfrom
onip:float_fix

Conversation

@onip
Copy link

@onip onip commented Dec 4, 2014

while porting an existing php (internal) library to node.js I've noticed that unpacking with 'f' results in rounded values (1.4 -> 1), while php and perl resulted in the correct floating number.

While not being nor a c++ nor a "node internals" expert I've tried this little patch that, in my tests (data is from actual internal test sets), solves the issue.

same problem happens with 'd' double data type, so the same correction is provided while I don't have enough data to test.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant

Comments