mirror of
https://github.com/josdejong/mathjs.git
synced 2026-01-25 15:07:57 +00:00
Added a test file to test the minified library
This commit is contained in:
parent
936820eee1
commit
2b4765433f
36
test/test.min.html
Normal file
36
test/test.min.html
Normal file
@ -0,0 +1,36 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<title>mathjs test</title>
|
||||
|
||||
<script src="../math.min.js" type="text/javascript"></script>
|
||||
</head>
|
||||
<body>
|
||||
<p>
|
||||
Use the mathjs library from the console...
|
||||
</p>
|
||||
<script>
|
||||
var Complex = math.Complex;
|
||||
var Unit = math.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));
|
||||
|
||||
var parser = new math.parser.Parser();
|
||||
|
||||
var workspace = new math.parser.Workspace();
|
||||
var id0 = workspace.append('a = 3/4');
|
||||
var id1 = workspace.append('a + 2');
|
||||
console.log('a = ' + workspace.getResult(id0));
|
||||
console.log('a + 2 = ' + workspace.getResult(id1));
|
||||
workspace.replace('a=5/2', id0);
|
||||
console.log('a = ' + workspace.getResult(id0));
|
||||
console.log('a + 2 = ' + workspace.getResult(id1));
|
||||
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
Loading…
x
Reference in New Issue
Block a user