Math.js is a lightweight open source JavaScript library that provides us with an extensive collection of mathematical useful functions.
You can easily download the Math.js library code browsing in GitHub at https://github.com/josdejong/mathjs. The following code sample shows how simple it is to use this library.
<!DOCTYPE html> <html> <head> <title>math.js demo</title> <script type="text/javascript" src="math.min.js"></script> </head> <body> <script type="text/javascript"> document.writeln("<br/>math.round(2.123456,3)="+math.round(2.123456,3)); document.writeln("<br/>math.log(4,12)="+math.log(4,12)); document.writeln("<br/>math.sqrt(49)="+math.sqrt(49)); </script> </body> </html>
The following video clip overviews this code sample, shows its execution and explains it.
You can find more video clips and training material for learning how to use this library in my free online courses website at http://abelski.lifemichael.com.