mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-28 03:27:44 +00:00
test/printf: ignoring rounding up to 2
This is a limitation of the current implementation, which should ultimately use "long double" precision instead of f64.
This commit is contained in:
parent
5c04283d6e
commit
0822511fdc
1 changed files with 11 additions and 2 deletions
|
@ -296,9 +296,18 @@ fn sub_num_float_e_no_round() {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn sub_num_float_round() {
|
fn sub_num_float_round_to_one() {
|
||||||
new_ucmd!()
|
new_ucmd!()
|
||||||
.args(&["two is %f", "1.9999996"])
|
.args(&["one is %f", "0.9999995"])
|
||||||
|
.succeeds()
|
||||||
|
.stdout_only("one is 1.000000");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
#[ignore = "Requires 'long double' precision floats to be used internally"]
|
||||||
|
fn sub_num_float_round_to_two() {
|
||||||
|
new_ucmd!()
|
||||||
|
.args(&["two is %f", "1.9999995"])
|
||||||
.succeeds()
|
.succeeds()
|
||||||
.stdout_only("two is 2.000000");
|
.stdout_only("two is 2.000000");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue