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:
committed by
Marijn Haverbeke
parent
e1f15a71e3
commit
e1251f7b00
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user