Merge pull request #9586 from b3liever/fix-hypot-js

Fix #9585 hypot in js
This commit is contained in:
Arne Döring 2018-10-31 21:53:40 +01:00 • committed by GitHub
commit d56312624e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -479,7 +479,8 @@ when not defined(JS): # C
## (-6.5 mod -2.5) == -1.5 ## (-6.5 mod -2.5) == -1.5
else: # JS 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: float32): float32 {.importC: "Math.pow", nodecl.}
proc pow*(x, y: float64): float64 {.importc: "Math.pow", nodecl.} proc pow*(x, y: float64): float64 {.importc: "Math.pow", nodecl.}
proc floor*(x: float32): float32 {.importc: "Math.floor", nodecl.} proc floor*(x: float32): float32 {.importc: "Math.floor", nodecl.}