mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-31 13:07:46 +00:00
seq: remove exponent exponent less than 0 check.
When exponent is greater than 0 we previously created a new string causing us to create a new string with a much larger size. This would the get passed to the BigDecimal crate which would get stuck.
This commit is contained in:
parent
efd7b6116c
commit
362deeca84
1 changed files with 11 additions and 17 deletions
|
@ -117,7 +117,6 @@ fn parse_exponent_no_decimal(s: &str, j: usize) -> Result<PreciseNumber, ParseNu
|
|||
};
|
||||
let num_fractional_digits = if exponent < 0 { -exponent as usize } else { 0 };
|
||||
|
||||
if exponent < 0 {
|
||||
if is_minus_zero_float(s, &x) {
|
||||
Ok(PreciseNumber::new(
|
||||
ExtendedBigDecimal::MinusZero,
|
||||
|
@ -131,11 +130,6 @@ fn parse_exponent_no_decimal(s: &str, j: usize) -> Result<PreciseNumber, ParseNu
|
|||
num_fractional_digits,
|
||||
))
|
||||
}
|
||||
} else {
|
||||
let zeros = "0".repeat(exponent.try_into().unwrap());
|
||||
let expanded = [&s[0..j], &zeros].concat();
|
||||
parse_no_decimal_no_exponent(&expanded)
|
||||
}
|
||||
}
|
||||
|
||||
/// Parse a number with a decimal point but no exponent.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue