Skip to content

Commit

Permalink
Merge 8cd849c into a1a42d7
Browse files Browse the repository at this point in the history
  • Loading branch information
Illya9999 committed Apr 15, 2021
2 parents a1a42d7 + 8cd849c commit 8fa8637
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion browser/encode.js
Expand Up @@ -83,7 +83,7 @@ function _encode(bytes, defers, value) {
// TODO: encode to float 32?

// float 64
if (Math.floor(value) !== value || !isFinite(value)) {
if (value !== (value | 0) || !isFinite(value)) {
bytes.push(0xcb);
defers.push({ _float: value, _length: 8, _offset: bytes.length });
return 9;
Expand Down
2 changes: 1 addition & 1 deletion lib/encode.js
Expand Up @@ -102,7 +102,7 @@ function _encode(bytes, defers, value) {
case 'number':
// TODO: encode to float 32?

if (Math.floor(value) !== value || !isFinite(value)) { // float 64
if (value !== (value | 0) || !isFinite(value)) { // float 64
bytes.push(0xcb);
defers.push({ float: value, length: 8, offset: bytes.length });
return 9;
Expand Down

0 comments on commit 8fa8637

Please sign in to comment.