mirror of
https://github.com/nim-lang/Nim.git
synced 2026-04-20 06:20:38 +00:00
add lost functions (#16843)
This commit is contained in:
@@ -105,6 +105,14 @@ func `**`*(x, y: JsBigInt): JsBigInt {.importjs: "((#) $1 #)".} =
|
||||
# pending https://github.com/nim-lang/Nim/pull/15940, simplify to:
|
||||
# doAssertRaises: discard big"2" ** big"-1" # raises foreign `RangeError`
|
||||
|
||||
func `and`*(x, y: JsBigInt): JsBigInt {.importjs: "(# & #)".} =
|
||||
runnableExamples:
|
||||
doAssert (big"555" and big"2") == big"2"
|
||||
|
||||
func `or`*(x, y: JsBigInt): JsBigInt {.importjs: "(# | #)".} =
|
||||
runnableExamples:
|
||||
doAssert (big"555" or big"2") == big"555"
|
||||
|
||||
func `xor`*(x, y: JsBigInt): JsBigInt {.importjs: "(# ^ #)".} =
|
||||
runnableExamples:
|
||||
doAssert (big"555" xor big"2") == big"553"
|
||||
|
||||
Reference in New Issue
Block a user