encoding: avoid division in write64.
This commit is contained in:
parent
b26b82ab97
commit
1aa0858f7c
@ -355,12 +355,12 @@ encoding._write64 = function _write64(dst, num, off, be) {
|
||||
|
||||
enforce(num <= MAX_SAFE_INTEGER, off, 'Number exceeds 2^53-1');
|
||||
|
||||
lo = num % 0x100000000;
|
||||
hi = (num - lo) / 0x100000000;
|
||||
hi = (num * (1 / 0x100000000)) | 0;
|
||||
lo = num | 0;
|
||||
|
||||
if (negative) {
|
||||
hi = ~hi >>> 0;
|
||||
lo = ~lo >>> 0;
|
||||
hi = ~hi;
|
||||
lo = ~lo;
|
||||
}
|
||||
|
||||
if (be) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user