We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 851fde8 commit 2bee613Copy full SHA for 2bee613
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