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>mathjs test</title>
|
|
|
|
<script src="../lib/math.js" type="text/javascript"></script>
|
|
</head>
|
|
<body>
|
|
<p>
|
|
Use the mathjs library from the console...
|
|
</p>
|
|
<script>
|
|
var Complex = math.type.Complex;
|
|
var Unit = math.type.Unit;
|
|
|
|
var complex1 = new Complex(3, -4);
|
|
console.log(complex1.toString());
|
|
|
|
console.log('sqrt(25) = ' + math.sqrt(25));
|
|
console.log('sqrt(' + complex1.toString() + ') = ' + math.sqrt(complex1));
|
|
console.log('sqrt(-4) = ' + math.sqrt(-4));
|
|
</script>
|
|
</body>
|
|
</html> |