source: imaps-frontend/node_modules/es-abstract/2021/ToBigUint64.js@ 79a0317

main
Last change on this file since 79a0317 was 79a0317, checked in by stefan toskovski <stefantoska84@…>, 3 days ago

F4 Finalna Verzija

  • Property mode set to 100644
File size: 708 bytes
Line 
1'use strict';
2
3var GetIntrinsic = require('get-intrinsic');
4
5var $BigInt = GetIntrinsic('%BigInt%', true);
6
7var $pow = require('math-intrinsics/pow');
8
9var ToBigInt = require('./ToBigInt');
10var BigIntRemainder = require('./BigInt/remainder');
11
12var modBigInt = require('../helpers/modBigInt');
13
14// BigInt(2**64), but node v10.4-v10.8 have a bug where you can't `BigInt(x)` anything larger than MAX_SAFE_INTEGER
15var twoSixtyFour = $BigInt && (BigInt($pow(2, 32)) * BigInt($pow(2, 32)));
16
17// https://262.ecma-international.org/11.0/#sec-tobiguint64
18
19module.exports = function ToBigUint64(argument) {
20 var n = ToBigInt(argument);
21 var int64bit = modBigInt(BigIntRemainder, n, twoSixtyFour);
22 return int64bit;
23};
Note: See TracBrowser for help on using the repository browser.