Created
August 29, 2021 11:36
-
-
Save CodeDrome/58fa79d482e71b32978f384fe7556a7c to your computer and use it in GitHub Desktop.
mathjsbignumber.js - part 2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function BigInts() | |
{ | |
output("BigInt<br>------<br><br>"); | |
const big1 = 9007199254740992n; // 9,007,199,254,740,992 | |
const big2 = 9007199254740993n; // 9,007,199,254,740,993 | |
output(`typeof(big1) = ${typeof(big1)}`); | |
output(`<br>big1 = ${big1}`); | |
output(`big2 = ${big2}`); | |
const r = 3n / 2n; | |
output(`<br>3n / 2n = ${3n / 2n}`); | |
try | |
{ | |
output("<br>Math.min(3n, 5n, 7n, 9n)"); | |
output(Math.min(3n, 5n, 7n, 9n)); | |
} | |
catch (e) | |
{ | |
output(e); | |
} | |
try | |
{ | |
output("<br>Math.sign(64n)"); | |
output(Math.sign(64n)); | |
} | |
catch (e) | |
{ | |
output(e); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment