Skip to content

printf: NaN print inconsistent with GNU coreutils #7412

Closed
@drinkcat

Description

@drinkcat
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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions