Skip to content

damianc/math-root

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 

Repository files navigation

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

About

Calculates the n-th root of a number.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published