coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

printf: NaN print inconsistent with GNU coreutils

Open drinkcat opened this issue 7 months ago • 0 comments

cargo run printf "%f %f\n" nan -nan
-NaN -NaN
printf "%f %f\n" nan -nan
nan -nan
  1. GNU coreutils prints lowercase nan (or NAN with %F, uutils does that too)
  2. GNU coreutils preserves the nan sign

1 is trivial to fix, 2 might be a trickier.

Probably not a huge deal in real use cases, but I'm trying to look into refactoring number formatting so I should be able to catch this one as well.

drinkcat avatar Mar 07 '25 10:03 drinkcat