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

format_test.format_double fails #3760

Closed
UnitedMarsupials opened this issue Dec 18, 2023 · 2 comments
Closed

format_test.format_double fails #3760

UnitedMarsupials opened this issue Dec 18, 2023 · 2 comments

Comments

@UnitedMarsupials
Copy link

UnitedMarsupials commented Dec 18, 2023

Compiling on FreeBSD-14/amd64, using the base compiler (clang-16.0.6). The build succeeds, but one of the tests fails:

[ RUN      ] format_test.format_double
.../fmtlib/work/fmt-10.1.1/test/format-test.cc:1354: Failure
Expected equality of these values:
  fmt::format("{:.9a}", xd)
    Which is: "0x2.000000000p+2"
  buffer
    Which is: "0x1.000000000p+3"
[  FAILED  ] format_test.format_double (3 ms)

Please, advise. Thank you!

@phprus
Copy link
Contributor

phprus commented Dec 18, 2023

The error occurs due to different rounding in different libc (macOS, glibc, FreeBSD 13,14):

format fmt glibc
{:.10a} 0x1.ffffffffffp+2 0x1.ffffffffffp+2
{:.9a} 0x2.000000000p+2 0x2.000000000p+2

Previous issues: #3512, #3433

I will make a fix for these tests.

@phprus
Copy link
Contributor

phprus commented Dec 18, 2023

Fix for test: #3762

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

3 participants