seq: compute correct width for -0e0#2657
Conversation
|
I don't know why the CI is complaining about this new test. It works on my machine (Ubuntu 18.04, rustc 1.55.0): |
d25bc41 to
d8c751a
Compare
Compute the correct width when an input argument is `-0e0`, that is,
floating point negative zero in scientific notation. For example,
$ seq -w -0e0 1
-0
01
d8c751a to
426c7ca
Compare
|
I see. The CI build is using an older version of And v1.53.0 causes the test to pass: I'll try to figure out what change I can make to get this code to work. |
|
Okay, I've figured it out. Consider this Rust program: fn main() {
println!("{}", (-0.0f64).to_string());
}When compiled with I believe this is due to this change rust-lang/rust#78618, which appears in v1.53.0: https://github.com/rust-lang/rust/blob/master/RELEASES.md#version-1530-2021-06-17 Since my other pull request, #2613, replaces this part of the code with something that doesn't suffer from this problem, I'm just going to close this pull request and make sure the unit test is included in that other branch. |
This adds code similar to the code in
print_seq_integers()that correctly supports negative zero as a starting number when the negative zero is given in the input in scientific notation.Before this change:
After this change:
That matches GNU seq: