mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-18 14:59:29 +00:00
24 lines
603 B
HTML
24 lines
603 B
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>Math2 Test</title>
|
|
|
|
<script src="../math2.js" type="text/javascript"></script>
|
|
</head>
|
|
<body>
|
|
<p>
|
|
Use the math2 library from the console...
|
|
</p>
|
|
<script>
|
|
var Complex = math2.type.Complex;
|
|
var Unit = math2.type.Unit;
|
|
|
|
var complex1 = new Complex(3, -4);
|
|
console.log(complex1.toString());
|
|
|
|
console.log('sqrt(25) = ' + math2.sqrt(25));
|
|
console.log('sqrt(' + complex1.toString() + ') = ' + math2.sqrt(complex1));
|
|
console.log('sqrt(-4) = ' + math2.sqrt(-4));
|
|
</script>
|
|
</body>
|
|
</html> |