Skip to content

Commit

Permalink
Update powers-of-2.html
Browse files Browse the repository at this point in the history
  • Loading branch information
mcnole25 committed Sep 6, 2024
1 parent 9d52d48 commit 64931da
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions powers-of-2.html
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,11 @@ <h1>Powers of 2 Calculator</h1>
result.innerHTML = (2 ** x).toFixed(100).replace(/(\.0+|0+)$/, "");
} else {
powerOf.innerHTML = "2<sup>" + x + "</sup> (" + Math.floor(Math.log10(2) * x + 1) + " digit/s)";
result.innerHTML = 2n ** BigInt(x);
}});
if (x > 300) {
result.innerHTML = BigInt(2 ** 300) * 2n ** BigInt(x - 300);
} else {
result.innerHTML = (2 ** x).toPrecision(100).replace(/(\.0+|0+)$/, "");
}}});
</script>
</body>
</html>

0 comments on commit 64931da

Please sign in to comment.