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 39b3809 commit 2d0d101Copy full SHA for 2d0d101
src/main.rs
@@ -138,7 +138,7 @@ impl Fraction {
138
fn from(value: String) -> Fraction {
139
let value = value.split("/").collect::<Vec<&str>>();
140
let mut fraction = Fraction {
141
- numerator: value.get(0).unwrap_or(&"0").parse::<isize>().unwrap_or(1),
+ numerator: value.get(0).unwrap_or(&"0").parse::<isize>().unwrap_or(0),
142
denominator: value.get(1).unwrap_or(&"1").parse::<isize>().unwrap_or(1),
143
};
144
fraction.simplify();
0 commit comments