回答編集履歴

1

BigInt(1) を 1n に修正

2022/11/13 08:12

投稿

arcxor
arcxor

スコア2859

test CHANGED
@@ -5,7 +5,7 @@
5
5
  ```js
6
6
  // (b ** e) % m の計算
7
7
  function modpow(b, e, m) {
8
- let result = BigInt(1);
8
+ let result = 1n;
9
9
 
10
10
  while (e > 0) {
11
11
  if ((e & 1n) === 1n) result = (result * b) % m;