langs a-z
This commit is contained in:
parent
db842d013d
commit
d066446780
11389 changed files with 98361 additions and 1020 deletions
13
Task/Arithmetic-Complex/OCaml/arithmetic-complex-1.ocaml
Normal file
13
Task/Arithmetic-Complex/OCaml/arithmetic-complex-1.ocaml
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
open Complex
|
||||
|
||||
let print_complex z =
|
||||
Printf.printf "%f + %f i\n" z.re z.im
|
||||
|
||||
let () =
|
||||
let a = { re = 1.0; im = 1.0 }
|
||||
and b = { re = 3.14159; im = 1.25 } in
|
||||
print_complex (add a b);
|
||||
print_complex (mul a b);
|
||||
print_complex (inv a);
|
||||
print_complex (neg a);
|
||||
print_complex (conj a)
|
||||
Loading…
Add table
Add a link
Reference in a new issue