Skip to content

Commit a8d8186

Browse files
authored
Merge pull request scala-js#4618 from catap/missed-bn
Add missed `/` for `js.BigInt`
2 parents 5c7ba1f + 6081bc9 commit a8d8186

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

library/src/main/scala/scala/scalajs/js/BigInt.scala

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,7 @@ final class BigInt private[this] () extends js.Object {
3131

3232
def +(other: BigInt): BigInt = js.native
3333
def *(other: BigInt): BigInt = js.native
34+
def /(other: BigInt): BigInt = js.native
3435
def -(other: BigInt): BigInt = js.native
3536
def %(other: BigInt): BigInt = js.native
3637

test-suite/js/src/test/scala/org/scalajs/testsuite/library/BigIntTest.scala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,9 @@ class BigIntTest {
7474
val multi = previousMaxSafe * js.BigInt(2)
7575
assertEquals(multi, js.BigInt("18014398509481982"))
7676

77+
val div = previousMaxSafe / js.BigInt(2)
78+
assertEquals(div, js.BigInt("4503599627370495"))
79+
7780
val subtr = multi - js.BigInt(10)
7881
assertEquals(subtr, js.BigInt("18014398509481972"))
7982

0 commit comments

Comments
 (0)