Javascript examples.
This commit is contained in:
parent
ecf9f96079
commit
48af60d829
76 changed files with 1685 additions and 0 deletions
25
Examples/javascript/operator/runme.js
Normal file
25
Examples/javascript/operator/runme.js
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
var example = require("./build/Release/example");
|
||||
|
||||
a = new example.Complex(2,3);
|
||||
b = new example.Complex(-5,10);
|
||||
|
||||
console.log ("a =" + a);
|
||||
console.log ("b =" + b);
|
||||
|
||||
c = a.plus(b);
|
||||
|
||||
console.log("c =" + c);
|
||||
console.log("a*b =" + a.times(b));
|
||||
console.log("a-c =" + a.minus(c));
|
||||
|
||||
e = example.Complex.copy(a.minus(c));
|
||||
console.log("e =" + e);
|
||||
|
||||
// Big expression
|
||||
f = a.plus(b).times(c.plus(b.times(e))).plus(a.uminus());
|
||||
console.log("f =" + f);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue