Skip to content

seq: zero gets padded if specified with scientific notation #6926

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
cakebaker opened this issue Dec 5, 2024 · 2 comments · Fixed by #6934
Closed

seq: zero gets padded if specified with scientific notation #6926

cakebaker opened this issue Dec 5, 2024 · 2 comments · Fixed by #6934
Labels

Comments

@cakebaker
Copy link
Contributor

I noticed that if I specify zero with scientific notation (and without specifying -w), the zero gets padded. With GNU seq, there is no padding:

$ cargo run -q seq 0e15 1
0000000000000000
1
$ seq 0e15 1
0
1
@aimerlief
Copy link
Contributor

I would like to work on this issue if it's not already being handled.

@sylvestre
Copy link
Contributor

sure :)

aimerlief added a commit to aimerlief/coreutils that referenced this issue Dec 7, 2024
- Updated the parse_exponent_no_decimal function to treat 0e... as zero.
- Added test cases to verify correct behavior for 0e15 and -w 0e15.

Fix: uutils#6926
aimerlief added a commit to aimerlief/coreutils that referenced this issue Dec 7, 2024
- Updated the parse_exponent_no_decimal function to treat 0e... as zero.
- Added test cases to verify correct behavior for 0e15 and -w 0e15.

Fix: uutils#6926
aimerlief added a commit to aimerlief/coreutils that referenced this issue Dec 7, 2024
- Updated the parse_exponent_no_decimal function to treat 0e... as zero.
- Added test cases to verify correct behavior for 0e15 and -w 0e15.

Fix: uutils#6926
cakebaker pushed a commit that referenced this issue Dec 7, 2024
* fix(seq): handle 0e... scientific notation without padding

- Updated the parse_exponent_no_decimal function to treat 0e... as zero.
- Added test cases to verify correct behavior for 0e15 and -w 0e15.

Fix: #6926

* fix(seq): improved parse for accurate BigDecimal handling

* apply missing cargo fmt formatting adjustments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants