Skip to content

Commit a0103cd

Browse files
committed
fixed issue with zoom without exponent
1 parent 9bc65cb commit a0103cd

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/util/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,12 @@ pub fn string_to_extended(string: &str) -> FloatExtended {
6666
let temp: Vec<&str> = string.split('E').collect();
6767

6868
let first = temp[0].parse::<f64>().unwrap();
69-
let second = temp[1].parse::<f64>().unwrap() * LOG2_10;
69+
70+
let second = if temp.len() < 2 {
71+
0.0
72+
} else {
73+
temp[1].parse::<f64>().unwrap() * LOG2_10
74+
};
7075

7176
FloatExtended::new(first * 2.0f64.powf(second.fract()), second.floor() as i32)
7277
}

0 commit comments

Comments
 (0)