Hi, here is sample code to reproduce the problem I struggle with:
#include <fmt/core.h>
int main(int argc, char ** argv) {
fmt::print("{:.2f}\n", 0.099f);
fmt::print("{:.2f}\n", 0.099L);
return 0;
}
Output is :
https://godbolt.org/z/rxMb5nEGP
Is there a reason why precision 2 is working differently for long double compared to float?
PS Output also vary by compiler:
clang 14, gcc 12 output is 0.1
vs 2022 output is 0.10
Hi, here is sample code to reproduce the problem I struggle with:
Output is :
https://godbolt.org/z/rxMb5nEGP
Is there a reason why precision 2 is working differently for long double compared to float?
PS Output also vary by compiler:
clang 14, gcc 12 output is 0.1
vs 2022 output is 0.10