Skip to content
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

seq: fails to parse hexadecimal floating-point arguments like 0x1p-1 #6935

Open
aimerlief opened this issue Dec 7, 2024 · 5 comments
Open
Labels

Comments

@aimerlief
Copy link
Contributor

While running bash util/run-gnu-test.sh, I encountered a bug where seq fails to handle hexadecimal arguments correctly. Specifically, the following command does not behave as expected:

$ cargo run -q seq 0x1p-1 2
seq: invalid hexadecimal argument: '0x1p-1'
$ seq 0x1p-1 2
0.5
1.5
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 14, 2024
Initial version of a hexadecimal float parser. This implementation is
intended for preview and further discussion.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 14, 2024
Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 14, 2024
@alexs-sh
Copy link
Contributor

@aimerlief Thx

@alexs-sh
Copy link
Contributor

Hello, I'd like to work on this issue

@alexs-sh
Copy link
Contributor

#6959 - here is an early PR draft, which introduces support for hexadecimal floating points. Mainly to kick off the review process and gather feedback. Any comments or suggestions are welcome

alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 14, 2024
This change fixes fuzz build and simplifies f64 / BigDecimal
conversions.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 14, 2024
Now test_parse_float_from_invalid_values checks the error code.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 14, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 14, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 14, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 15, 2024
Initial version of a hexadecimal float parser. This implementation is
intended for preview and further discussion.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 15, 2024
Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 15, 2024
Fix the test that fails after the implementation of the floating-point
format. The expected output now matches the GNU seq output.

    seq 0xlmnop
    seq: invalid floating point argument: ‘0xlmnop’

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 15, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 15, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 15, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 15, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 15, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 16, 2024
Initial version of a hexadecimal float parser. This implementation is
intended for preview and further discussion.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 16, 2024
Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 16, 2024
Fix the test that fails after the implementation of the floating-point
format. The expected output now matches the GNU seq output.

    seq 0xlmnop
    seq: invalid floating point argument: ‘0xlmnop’

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 16, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 16, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 16, 2024
Initial version of a hexadecimal float parser. This implementation is
intended for preview and further discussion.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 16, 2024
Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 16, 2024
Fix the test that fails after the implementation of the floating-point
format. The expected output now matches the GNU seq output.

    seq 0xlmnop
    seq: invalid floating point argument: ‘0xlmnop’

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 16, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 29, 2024
Initial version of a hexadecimal float parser. This implementation is
intended for preview and further discussion.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 29, 2024
Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 29, 2024
Fix the test that fails after the implementation of the floating-point
format. The expected output now matches the GNU seq output.

    seq 0xlmnop
    seq: invalid floating point argument: ‘0xlmnop’

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 29, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Dec 29, 2024
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 2, 2025
Initial version of a hexadecimal float parser. This implementation is
intended for preview and further discussion.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 2, 2025
Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 2, 2025
Fix the test that fails after the implementation of the floating-point
format. The expected output now matches the GNU seq output.

    seq 0xlmnop
    seq: invalid floating point argument: ‘0xlmnop’

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 2, 2025
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 2, 2025
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
Initial version of a hexadecimal float parser. This implementation is
intended for preview and further discussion.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
Fix the test that fails after the implementation of the floating-point
format. The expected output now matches the GNU seq output.

    seq 0xlmnop
    seq: invalid floating point argument: ‘0xlmnop’

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
Initial version of a hexadecimal float parser. This implementation is
intended for preview and further discussion.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
Fix the test that fails after the implementation of the floating-point
format. The expected output now matches the GNU seq output.

    seq 0xlmnop
    seq: invalid floating point argument: ‘0xlmnop’

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
Initial version of a hexadecimal float parser. This implementation is
intended for preview and further discussion.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
Fix the test that fails after the implementation of the floating-point
format. The expected output now matches the GNU seq output.

    seq 0xlmnop
    seq: invalid floating point argument: ‘0xlmnop’

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 4, 2025
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 5, 2025
Initial version of a hexadecimal float parser. This implementation is
intended for preview and further discussion.

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 5, 2025
Turn on the float parser. Now it's possible to use hexadecimal floats as
parameters. For example,

    cargo run -- 0x1p-1 3
    0.5
    1.5
    2.5

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 5, 2025
Fix the test that fails after the implementation of the floating-point
format. The expected output now matches the GNU seq output.

    seq 0xlmnop
    seq: invalid floating point argument: ‘0xlmnop’

Issue uutils#6935
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 5, 2025
alexs-sh added a commit to alexs-sh/coreutils that referenced this issue Jan 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants