Category talk:Wren-math: Difference between revisions
Content added Content deleted
(→Source code: Added various integer root functions..) |
(→Source code: Changed name of just added isRoot method to isPower) |
||
Line 184: | Line 184: | ||
// Returns whether or not 'x' is a perfect 'n'th power. |
// Returns whether or not 'x' is a perfect 'n'th power. |
||
static |
static isPower(n, x) { |
||
var r = root(n, x) |
var r = root(n, x) |
||
return r.pow(n) == x |
return r.pow(n) == x |