diff options
author | flywind <43030857+xflywind@users.noreply.github.com> | 2021-01-29 08:14:19 -0600 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-01-29 15:14:19 +0100 |
commit | 296cf9657cdf50141b6115a58fc38e3bc5aa0626 (patch) | |
tree | 04d856d7fe1193ed4aa275250630248576fb3c15 /lib/std | |
parent | f09d97d6d37520e41aa295e43b6901ce49132aac (diff) | |
download | Nim-296cf9657cdf50141b6115a58fc38e3bc5aa0626.tar.gz |
add lost functions (#16843)
Diffstat (limited to 'lib/std')
-rw-r--r-- | lib/std/jsbigints.nim | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/std/jsbigints.nim b/lib/std/jsbigints.nim index edef6844f..b62528abd 100644 --- a/lib/std/jsbigints.nim +++ b/lib/std/jsbigints.nim @@ -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" |