Closed dhylands closed 6 years ago
Cool! You could also add something to format floats, like: println!("{:.*}", 2, 1.234567);
The current code uses {:.1} but I'll try adding what you suggested and see how it performs
Wow. I added these 2 functions:
fn test1f2() {
let num1: f64 = 1.234;
println!("{:.*}", 2, num1);
}
fn test2f2() {
let num1: f64 = 1.234;
let num2: f64 = 2.345;
println!("{:.*} {:.*}", 2, num1, 2, num2);
}
test1f2 required 1504 bytes test2f2 required an additional 724 bytes Adding one more only needed 80 extra bytes.
So that means test2f2 needed a total of 2900 bytes of stack space.
Closing old PRs
I get these results: