diff options
author | B3liever <b3lievem@yandex.com> | 2018-10-31 14:09:39 +0200 |
---|---|---|
committer | B3liever <b3lievem@yandex.com> | 2018-10-31 14:09:39 +0200 |
commit | 8a1d52fa4853c3e6bbefe8817f4cc2f0de035419 (patch) | |
tree | a9ade8681a0f2ce3db30a649cd3df555e452bda5 /lib | |
parent | 313bbf5b9b1898fd7f6ec7378f71cfa06ffe52ec (diff) | |
download | Nim-8a1d52fa4853c3e6bbefe8817f4cc2f0de035419.tar.gz |
Fix #9585 hypot in js
Diffstat (limited to 'lib')
-rw-r--r-- | lib/pure/math.nim | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/pure/math.nim b/lib/pure/math.nim index e2ad626de..ee32772b1 100644 --- a/lib/pure/math.nim +++ b/lib/pure/math.nim @@ -479,7 +479,8 @@ when not defined(JS): # C ## (-6.5 mod -2.5) == -1.5 else: # JS - proc hypot*[T: float32|float64](x, y: T): T = return sqrt(x*x + y*y) + proc hypot*(x, y: float32): float32 {.importc: "Math.hypot", varargs, nodecl.} + proc hypot*(x, y: float64): float64 {.importc: "Math.hypot", varargs, nodecl.} proc pow*(x, y: float32): float32 {.importC: "Math.pow", nodecl.} proc pow*(x, y: float64): float64 {.importc: "Math.pow", nodecl.} proc floor*(x: float32): float32 {.importc: "Math.floor", nodecl.} |