Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 351 Bytes

README.md

File metadata and controls

15 lines (11 loc) · 351 Bytes

math-root

Calculates the n-th root of a number.

JavaScript provides methods to calculate the 2nd and 3rd root - Math.sqrt() and Math.cbrt() respectively.
... and that's it! With this method you can calculate other roots.

Math.root(x,n) - $\sqrt[n]{x}$

const two = Math.root(16, 4);
// the 4th root of 16

console.log(two);
// 2