Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 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