summary refs log tree commit diff stats
path: root/lib
diff options
context:
space:
mode:
authorBenjamin Summerton <define-private-public@users.noreply.github.com>2019-06-18 02:26:47 -0400
committerVarriount <Varriount@users.noreply.github.com>2019-06-18 02:26:47 -0400
commita009cbdc2fc1922dfc90b178f34e1867598a3296 (patch)
tree0e71cb61a12465b2c85c0db252cd587b3b47f529 /lib
parentc8268330be4de61541aa34eb82f7a93dc62e627c (diff)
downloadNim-a009cbdc2fc1922dfc90b178f34e1867598a3296.tar.gz
Add `cbrt()` bindings for the JS Target (#11528)
`Math.cbrt()` exists:
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/cbrt

The binding was missing for the JavaScript backend.
Diffstat (limited to 'lib')
-rw-r--r--lib/pure/math.nim3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/pure/math.nim b/lib/pure/math.nim
index f73d9c8f1..119087107 100644
--- a/lib/pure/math.nim
+++ b/lib/pure/math.nim
@@ -298,6 +298,9 @@ else: # JS
   proc sqrt*(x: float32): float32 {.importc: "Math.sqrt", nodecl.}
   proc sqrt*(x: float64): float64 {.importc: "Math.sqrt", nodecl.}
 
+  proc cbrt*(x: float32): float32 {.importc: "Math.cbrt", nodecl.}
+  proc cbrt*(x: float64): float64 {.importc: "Math.cbrt", nodecl.}
+
   proc ln*(x: float32): float32 {.importc: "Math.log", nodecl.}
   proc ln*(x: float64): float64 {.importc: "Math.log", nodecl.}