Change all ternary ops to if/then/else

All the files below had at least one instance of the ternary operator
present in the source.  All have been changed to the equivalent
if/then/else expression.
This commit is contained in:
Paul Woolcock
2012-01-29 21:33:08 -05:00
committed by Marijn Haverbeke
parent e1f15a71e3
commit e1251f7b00
18 changed files with 183 additions and 68 deletions

View File

@@ -46,7 +46,7 @@ exact - Whether to enforce the exact number of significant digits
*/
fn to_str_common(num: float, digits: uint, exact: bool) -> str {
if is_NaN(num) { ret "NaN"; }
let (num, accum) = num < 0.0 ? (-num, "-") : (num, "");
let (num, accum) = if num < 0.0 { (-num, "-") } else { (num, "") };
let trunc = num as uint;
let frac = num - (trunc as float);
accum += uint::str(trunc);