mathjs/test/test.html
2013-02-17 15:54:48 +01:00

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>