CDE
This commit is contained in:
parent
518da4a923
commit
764da6cbbb
6144 changed files with 83610 additions and 11 deletions
11
Task/Arithmetic-Complex/D/arithmetic-complex.d
Normal file
11
Task/Arithmetic-Complex/D/arithmetic-complex.d
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
import std.stdio, std.complex;
|
||||
|
||||
void main() {
|
||||
auto x = complex(1, 1); // complex of doubles on default
|
||||
auto y = complex(3.14159, 1.2);
|
||||
|
||||
writeln(x + y); // addition
|
||||
writeln(x * y); // multiplication
|
||||
writeln(1.0 / x); // inversion
|
||||
writeln(-x); // negation
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue