Files
Jaideep Pyne 9b7771489d test(parser): pin exact whole-number unit literals and scaled overflow (#18898)
## Description

Filesize and duration literals lose precision because `parse_unit_value`
parses the numeric part through an `f64`. `Filesize` is backed by an
`i64`, so large exact integers get silently rounded — e.g.
`6504534684301572998b` parses as `6504534684301573120b`, off by 122
bytes (#10612).

This parses the numeric part as an `i64` when it's a whole number and
computes the base-unit value (bytes / nanoseconds) with checked integer
arithmetic. Fractional literals, and anything that would overflow `i64`,
fall back to the existing `f64` path, so everything that already worked
is unchanged. The unit factors are all whole numbers, so the integer
conversion is lossless.

## User-facing changes (Release notes)

- Fixed large whole-number filesize and duration literals (e.g.
`6504534684301572998b`) losing precision when parsed.

## Additional notes

Fixes #10612
2026-10-18 12:39:05 -05:00
..
2026-01-26 10:17:45 +08:00
2026-07-26 20:08:36 +02:00