coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

printf: %a not supported (but partially implemented)

Open jfinkels opened this issue 3 years ago • 7 comments

$ 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

jfinkels avatar Dec 16 '21 23:12 jfinkels

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.

stale[bot] avatar Jan 13 '23 12:01 stale[bot]

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.

tertsdiepraam avatar Feb 07 '24 11:02 tertsdiepraam