Skip to content

od: default -t f to double precision#11396

Merged
sylvestre merged 2 commits intouutils:mainfrom
can1357:od-default-t-f-to-double-precision
Apr 3, 2026
Merged

od: default -t f to double precision#11396
sylvestre merged 2 commits intouutils:mainfrom
can1357:od-default-t-f-to-double-precision

Conversation

@can1357
Copy link
Copy Markdown
Contributor

@can1357 can1357 commented Mar 18, 2026

uutils od -t f defaults to 4-byte floats when no explicit size is provided. GNU od defaults -t f to sizeof(double) (8 bytes), so values and grouping diverge.

Reproduction Steps

printf '\x00\x00\x80\x3f\x00\x00\x00\x40' | od -An -t f
# Expected (GNU):        2.000000473111868
# Actual (uutils):       1.0000000       2.0000000

Impact

Pipelines that parse od -t f output misinterpret binary data under uutils because element width and decoded values differ from GNU semantics.

sylvestre added a commit to sylvestre/coreutils-1 that referenced this pull request Apr 3, 2026
* tests/od/od.pl: Add tests to ensure -t f (no size suffix) defaults
to double precision (8 bytes), matching -t fD, and differs from -t fF
(explicit 4-byte float).
uutils/coreutils#11396
sylvestre added a commit to sylvestre/coreutils-1 that referenced this pull request Apr 3, 2026
* tests/od/od.pl: Add tests to ensure -t f (no size suffix) defaults
to double precision (8 bytes), matching -t fD, and differs from -t fF
(explicit 4-byte float).
uutils/coreutils#11396
@sylvestre sylvestre merged commit 8e05053 into uutils:main Apr 3, 2026
162 of 163 checks passed
hubot pushed a commit to coreutils/coreutils that referenced this pull request Apr 6, 2026
* tests/od/od-float.sh: Add cases to ensure -t f = -t fD,
and also verify the resulting number.
uutils/coreutils#11396
#241
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants