You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
fn main () {
let f_e_9: f64 = 1e9f64;
let f_e_10: f64 = 1e10f64;
let f_e_19: f64= 1e19f64;
let u_e_9: u64 = 1e9f64 as u64;
let u_e_10: u64 = 1e10f64 as u64;
let u_e_19: u64 = 1e19f64 as u64;
let i_e_9: i64 = 1e9f64 as i64;
let i_e_10: i64 = 1e10f64 as i64;
let i_e_18: i64 = 1e18f64 as i64;
io::println(f_e_9.to_str());
io::println(f_e_10.to_str());
io::println(f_e_19.to_str());
io::println(u_e_9.to_str());
io::println(u_e_10.to_str());
io::println(u_e_19.to_str());
io::println(i_e_9.to_str());
io::println(i_e_10.to_str());
io::println(i_e_18.to_str());
}
It's probably because those functions are using int and uint internally, and I'm running them on a 32bit linux. I'm currently writing generic replacements for the numeric to_str() and from_str() functions anyway, it just makes debugging either kinda a chicken-egg problem ;)
This code:
produces this output:
For the record, the maximum value of a
f32
is ~1e38
, and for af64
~1e308
.The text was updated successfully, but these errors were encountered: