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.

(cherry picked from commit a009cbdc2f)
This commit is contained in:
Benjamin Summerton
2019-06-18 02:26:47 -04:00
committed by narimiran
parent 4144893ba2
commit c1097ea949

View File

@@ -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.}