1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Merge pull request #7556 from drinkcat/parse-bigdecimal

uucore: format: num_parser: Use ExtendedBigDecimal
This commit is contained in:
Dorian Péron 2025-04-01 10:52:50 +02:00 committed by GitHub
commit ace92dcca1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 522 additions and 260 deletions

View file

@ -992,6 +992,16 @@ fn float_flag_position_space_padding() {
.stdout_only(" +1.0");
}
#[test]
fn float_large_precision() {
// Note: This does not match GNU coreutils output (0.100000000000000000001355252716 on x86),
// as we parse and format using ExtendedBigDecimal, which provides arbitrary precision.
new_ucmd!()
.args(&["%.30f", "0.1"])
.succeeds()
.stdout_only("0.100000000000000000000000000000");
}
#[test]
fn float_non_finite_space_padding() {
new_ucmd!()