Skip to content

printf: %a output exponent is incorrect (should be decimal, not hexadecimal) #7362

Open
@drinkcat

Description

%a should output "Hexadecimal floating point, lowercase"

For small numbers below 1, the exponent is printed incorrectly:

$ cargo run printf "%a\n" 0.5
0x1.0000000000000p+ffffffffffffffff /// This should be 0x1.0000000000000p-1
$ printf "%a\n" 0.5
0x8p-4

We'll cover issues with shifting (0x8 or 0x1) and padding in another issue.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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