We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9bc65cb commit a0103cdCopy full SHA for a0103cd
src/util/mod.rs
@@ -66,7 +66,12 @@ pub fn string_to_extended(string: &str) -> FloatExtended {
66
let temp: Vec<&str> = string.split('E').collect();
67
68
let first = temp[0].parse::<f64>().unwrap();
69
- let second = temp[1].parse::<f64>().unwrap() * LOG2_10;
+
70
+ let second = if temp.len() < 2 {
71
+ 0.0
72
+ } else {
73
+ temp[1].parse::<f64>().unwrap() * LOG2_10
74
+ };
75
76
FloatExtended::new(first * 2.0f64.powf(second.fract()), second.floor() as i32)
77
}
0 commit comments