You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I found a floating point rounding error in ToStr.
Also, I would expect that ToStr should return exactly the same as Show returns, including all whitespaces.
#[deriving(Show,ToStr)]structS{f:f32,d:f64,}fnmain(){let f :f32 = 1.8;println!("{}", f);// prints '1.8'println!("{}", f.to_str());// prints '1.79999995'let s = S{f:1.8,d:1.8};println!("{}", s);// prints 'S { f: 1.8, d: 1.8 }'println!("{}", s.to_str());// prints 'S{f: 1.79999995, d: 1.8}'}