half-rs icon indicating copy to clipboard operation
half-rs copied to clipboard

Weird formatting behavior

Open TheIronBorn opened this issue 2 weeks ago • 0 comments

this code:

let x = f16::from_f32(std::f32::consts::PI);
println!("{:.1e}", x);
println!("{:.1e}", f32::from(x));

produces this

3.140625e0
3.1e0

f16::debug just uses fmt(self.to_f32(), f) so I don't know what might be causing this

TheIronBorn avatar Jun 17 '24 22:06 TheIronBorn