Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
16
Task/Arithmetic-Complex/Rust/arithmetic-complex.rust
Normal file
16
Task/Arithmetic-Complex/Rust/arithmetic-complex.rust
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
extern crate num;
|
||||
use num::complex::Complex;
|
||||
|
||||
fn main() {
|
||||
// two valid forms of definition
|
||||
let a = Complex {re:-4.0, im: 5.0};
|
||||
let b = Complex::new(1.0, 1.0);
|
||||
|
||||
println!(" a = {}", a);
|
||||
println!(" b = {}", b);
|
||||
println!(" a + b = {}", a + b);
|
||||
println!(" a * b = {}", a * b);
|
||||
println!(" 1 / a = {}", a.inv());
|
||||
println!(" -a = {}", -a);
|
||||
println!("conj(a) = {}", a.conj());
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue