UNPKG

639 BHTMLView Raw
1<!DOCTYPE html>
2<html>
3<head>
4 <title>mathjs test</title>
5
6 <script src="../dist/math.min.js" type="text/javascript"></script>
7</head>
8<body>
9<p>
10 Use the mathjs library from the console...
11</p>
12<script>
13 function print (args) {
14 for (var i = 0; i < arguments.length; i++) {
15 document.write(arguments[i] + '');
16 }
17 document.write('<br>');
18 }
19
20 var complex1 = math.complex(3, -4);
21 print(complex1.toString());
22
23 print('sqrt(25) = ' + math.sqrt(25));
24 print('sqrt(' + complex1.toString() + ') = ' + math.sqrt(complex1));
25 print('sqrt(-4) = ' + math.sqrt(-4));
26
27 var parser = math.parser();
28
29</script>
30</body>
31</html>
\No newline at end of file