I am implementing the CORDIC algorithm for the sin
trigonometric function. In order to do this, I need to hardcode/calculate a bunch of arctangent values. Right
This answer was written for Rust 0.12.0 and doesn't apply to Rust 1.x.
You can use std::f32::to_string to print all the digits.
use std::f32;
fn main() {
let pi: f32 = 3.1415926536897932384626;
let k1: f32 = 0.6072529350088812561694; // 1/k
println!("pi is {}", f32::to_string(pi));
println!("k1 is {}", f32::to_string(k1));
}
Output:
pi is 3.1415927410125732421875
k1 is 0.607252979278564453125