We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 599cbf7 + 2bee613 commit 56f0979Copy full SHA for 56f0979
src/libcore/float.rs
@@ -42,6 +42,8 @@ Converts a float to a string
42
"]
43
fn to_str_common(num: float, digits: uint, exact: bool) -> str {
44
if is_NaN(num) { ret "NaN"; }
45
+ if num == infinity { ret "inf"; }
46
+ if num == neg_infinity { ret "-inf"; }
47
let mut (num, accum) = if num < 0.0 { (-num, "-") } else { (num, "") };
48
let trunc = num as uint;
49
let mut frac = num - (trunc as float);
0 commit comments