Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect printing of float/double in 7.1.1 #1976

Closed
madscientist opened this issue Nov 4, 2020 · 3 comments
Closed

Incorrect printing of float/double in 7.1.1 #1976

madscientist opened this issue Nov 4, 2020 · 3 comments

Comments

@madscientist
Copy link

madscientist commented Nov 4, 2020

I'm seeing a problem printing with {:f} in 7.1.1.

Here is the test program:

#include <fmt/core.h>

int main()
{
    double dbl = (double)9223372036854775807;
    fmt::print("double {:f}\n", dbl);
    return 0;
}

In 7.0.3 I get reasonable results:

double 9223372036854775808.000000

In 7.1.1 I get something I can't understand at all:

double B446744073709551616.000000

This is on a GNU/Linux system compiled with GCC 10.2.

@madscientist madscientist changed the title Incorrect printing of float/double in 7.1.0 Incorrect printing of float/double in 7.1.1 Nov 4, 2020
@madscientist
Copy link
Author

I tried 7.1.0 and see the same (incorrect) results.

@madscientist
Copy link
Author

madscientist commented Nov 4, 2020

Bisecting shows this change in behavior was introduced by SHA 9f312fe

commit 9f312fe87e476d2ef91d347a8d1cd5f7dd9cb730
Author: Victor Zverovich <viz@fb.com>
Date:   Mon Sep 7 09:34:05 2020 -0700

    Implement fallback FP formatting with given precision (#1526)

@vitaut
Copy link
Contributor

vitaut commented Nov 4, 2020

Good catch, thanks! Fixed in 6b7bfed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants