coreutils
coreutils copied to clipboard
printf: %a not supported (but partially implemented)
$ printf "%a\n" 255
0xf.fp+4
$ ./target/debug/coreutils printf "%a\n" 255
printf: %a: invalid conversion specification
Here is the description of the floating-point conversions: https://www.gnu.org/software/libc/manual/html_node/Floating_002dPoint-Conversions.html
This seems to be called CninetyNineHexFloatf in the code: https://github.com/uutils/coreutils/blob/ca705e5ad2bc6b0b0c5dde0d0c1df38bcb0f2148/src/uu/printf/src/tokenize/num_format/formatters/cninetyninehexfloatf.rs#L11 but it seems to be only partially implemented and not exposed to the user: https://github.com/uutils/coreutils/blob/ca705e5ad2bc6b0b0c5dde0d0c1df38bcb0f2148/src/uu/printf/src/tokenize/sub.rs#L163
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
There's been progress on this in https://github.com/uutils/coreutils/pull/5128, but it's not quite correct yet. The current output of you example is
0x1.fe00000000000p+7
Looks like my implementation isn't quite right.