seq: remove is_minus_zero_float check on parse_exponent_no_decimal

This commit is contained in:
maxer137 2024-04-03 16:07:04 +02:00
parent 874c4f23c0
commit efd7b6116c

View file

@ -103,20 +103,17 @@ fn parse_exponent_no_decimal(s: &str, j: usize) -> Result<PreciseNumber, ParseNu
// displayed as "0.01", but "1e2" will be displayed as "100", // displayed as "0.01", but "1e2" will be displayed as "100",
// without a decimal point. // without a decimal point.
let x: BigDecimal = s.parse().map_err(|_| ParseNumberError::Float)?; let x: BigDecimal = s.parse().map_err(|_| ParseNumberError::Float)?;
let num_integral_digits = if is_minus_zero_float(s, &x) {
2 let total = j as i64 + exponent;
let result = if total < 1 {
1
} else { } else {
let total = j as i64 + exponent; total.try_into().unwrap()
let result = if total < 1 { };
1 let num_integral_digits = if x.sign() == Sign::Minus {
} else { result + 1
total.try_into().unwrap() } else {
}; result
if x.sign() == Sign::Minus {
result + 1
} else {
result
}
}; };
let num_fractional_digits = if exponent < 0 { -exponent as usize } else { 0 }; let num_fractional_digits = if exponent < 0 { -exponent as usize } else { 0 };