I'm very new to the Rust programming language and I am excited to get going. I have been using Julia for several months now to process complex numbers. However, I want to transfer some of my algorithms to a compiled language. Rust may be over kill because I could use C, but I want to try something new and Rust looks very nice. I wrote the following little snippet and it runs. However, I need to extract the real and imaginary parts and I have been unsuccessful in finding functions in the "num" crate to do that. I'm looking for something like fn real() and fn imag(), but I do not see such functions. What am I missing? Thanks for any help!
//Example of simple RUST program using while loop
extern crate num;
use num::complex::Complex;
fn main() {
let mut n=0.0;
let x = Complex::new(-1.0, 0.0);
while n < 1.01 {
let y = Complex::powf(&x, n);
println!("n = {:0.2}, y ={:0.4}",n,y);
n=n+0.02;
}
}