summary refs log tree commit diff stats
path: root/compiler
diff options
context:
space:
mode:
authorflywind <43030857+xflywind@users.noreply.github.com>2020-12-30 08:09:30 -0600
committerGitHub <noreply@github.com>2020-12-30 15:09:30 +0100
commit515cd454207ed9066c08ac8ef42407ae5ba62bc8 (patch)
tree198194fab86a5fa63eb707ba6df3803e9274022e /compiler
parent73f778e441cd4229af4115f762bd597a8a20fb74 (diff)
downloadNim-515cd454207ed9066c08ac8ef42407ae5ba62bc8.tar.gz
Add math.copySign (#16406)
* add math.copySign
* fix + tests
Diffstat (limited to 'compiler')
-rw-r--r--compiler/vmops.nim6
1 files changed, 6 insertions, 0 deletions
diff --git a/compiler/vmops.nim b/compiler/vmops.nim
index 47df3d24f..3e859d3d7 100644
--- a/compiler/vmops.nim
+++ b/compiler/vmops.nim
@@ -13,6 +13,9 @@ from math import sqrt, ln, log10, log2, exp, round, arccos, arcsin,
   arctan, arctan2, cos, cosh, hypot, sinh, sin, tan, tanh, pow, trunc,
   floor, ceil, `mod`
 
+when declared(math.copySign):
+  from math import copySign
+
 from os import getEnv, existsEnv, dirExists, fileExists, putEnv, walkDir, getAppFilename
 from md5 import getMD5
 from sighashes import symBodyDigest
@@ -168,6 +171,9 @@ proc registerAdditionalOps*(c: PCtx) =
   wrap1f_math(floor)
   wrap1f_math(ceil)
 
+  when declared(copySign):
+    wrap2f_math(copySign)
+
   wrap1s(getMD5, md5op)
 
   proc `mod Wrapper`(a: VmArgs) {.nimcall.} =