blob: a700918d6bb09767bef43923f150a73b91cf63d0 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
|
var example = require("./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);
|