Closed NobodyXu closed 2 years ago
If std::fmt is formatting it as 0 as well, I would propose that this is unlikely to be a bug in this crate.
Once whatever is broken in std or rustc has been fixed, if ryu is still incorrect after that, please follow up.
Sure.
@dtolnay Please reopen this as the nightly rustc
has fixed the error formatting 3.2_f32
as 0.0
, but ryu
still format it as 0.0
according to this CI log, though it can format f64
correctly.
What was the fix?
What was the fix?
We didn't fix the code, somehow after updating nightly, the bug is fixed, but ryu still format 3.2_f32 as 0.0, but format the f64 correctly.
I also discovered a minor bug in std format, f32::NEG_INFINITY is formatted as "inf" instead of "-inf".
If it randomly goes away without any relevant code changes in std's formatting code, I am still extremely skeptical that it would need a code change in ryu's formatting code as opposed to the bug being elsewhere.
If it randomly goes away without any relevant code changes in std's formatting code, I am still extremely skeptical that it would need a code change in ryu's formatting code as opposed to the bug being elsewhere.
Yeah, it looks like a bug in generating the assembly in rustc
or llvm
.
In my PR https://github.com/ParkMyCar/compact_str/pull/16 , when formatting 3.2 using ryu (currently disabled due to bug), it gives me 0.0 on target powerpc64le instead of 3.2 (it works on all other target).
P.S. formatting using std on the target gives me 0