Hello,
I'm looking for the code that formats f64, or any documentation of it.
I mean, if I write
let x: f64 = 12345;
println!("{}", x);
where is the code that actually turns my number into characters? Thanks!
Hello,
I'm looking for the code that formats f64, or any documentation of it.
I mean, if I write
let x: f64 = 12345;
println!("{}", x);
where is the code that actually turns my number into characters? Thanks!
Rust uses the Grisu algorithm, the code is in core::num::flt2dec::strategy::grisu.
There are other details, but you should be able to look them up yourself by searching for flt2dec in the codebase.
Awesome, thanks!
This topic was automatically closed 540 days after the last reply. New replies are no longer allowed.