Arithmetic/Complex: Difference between revisions

-> Maple
(→‎{{header|Java}}: Added print method and tests for the new task description)
(-> Maple)
Line 253:
}
}</java>
 
=={{header|Maple}}==
 
Maple has "I" (the square root of -1) built-in. Thus:
 
x := 1+I;
y := Pi+I*1.2;
 
By itself, it will perform mathematical operations symbolically, i.e. it will not try to perform computational evaluation unless specifically asked to do so. Thus:
 
x*y;
==> (1 + I) (Pi + 1.2 I)
simplify(x*y);
==> 1.941592654 + 4.341592654 I
 
Other than that, the task merely asks for
 
x+y;
x*y;
-x;
1/x;
Anonymous user