-
Notifications
You must be signed in to change notification settings - Fork 40
Open
Description
Both functions readFloat64BE and readFloat64LE are buggy at the following line:
(((b5 & 0x7F) << 24) | (b6 << 16) | (b7 << 8) | b8).toString(2)
If you do, for example:
var b5 = 0, b6 = 0, b7 = 0, b8 = 0;
The expected value should be "0000000000000000000000000000000" (31 zeros), but instead it returns "0"
I solved it by using:
("000000000000000000000000000000" + (((b5 & 0x7F) << 24) | (b6 << 16) | (b7 << 8) | b8).toString(2)).substr(-31)
But this solution isn't cross-browser.
Tested on Firefox 12.0
Thank you for your great work.
Metadata
Metadata
Assignees
Labels
No labels