Describe the bug
Parsing signed decimal numbers in e-notation has a bug, whereby the parsed values is magnified by an order of magnitude (leading to potential false overflows).
To Reproduce
Run the following test (e.g. in arrow-cast/src/parse.rs)
The first assertion will fail, as the parsed value is erroneously -11000000000, while the second example will panic with parse decimal overflow (-1e31), even though the value fits in the specified precision/scale range.
Expected behavior
The first test case above should return -1000000000i128 (i.e. 3 zeros from e3 + additional 6 zeros from the scale).
The seconds case shouldn't overflow and should instead return -10000000000000000000000000000000000000i128 (i.e. 31 zeros from e31 + additional 6 zeros from the scale).
Describe the bug Parsing signed decimal numbers in e-notation has a bug, whereby the parsed values is magnified by an order of magnitude (leading to potential false overflows).
To Reproduce Run the following test (e.g. in
arrow-cast/src/parse.rs
)The first assertion will fail, as the parsed value is erroneously
-11000000000
, while the second example will panic withparse decimal overflow (-1e31)
, even though the value fits in the specified precision/scale range.Expected behavior The first test case above should return
-1000000000i128
(i.e. 3 zeros frome3
+ additional 6 zeros from the scale).The seconds case shouldn't overflow and should instead return
-10000000000000000000000000000000000000i128
(i.e. 31 zeros frome31
+ additional 6 zeros from the scale).Additional context