-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!
Description
C:\Temp>type meow.cpp
#include <iomanip>
#include <iostream>
#include <limits>
using namespace std;
int main() {
constexpr double inf_dbl = numeric_limits<double>::infinity();
constexpr double nan_dbl = numeric_limits<double>::quiet_NaN();
cout << "setprecision(0) showpoint fixed:\n";
cout << setprecision(0) << showpoint << fixed;
cout << inf_dbl << "\n";
cout << -inf_dbl << "\n";
cout << nan_dbl << "\n";
cout << -nan_dbl << "\n";
cout << "\nAnd showpos:\n";
cout << showpos;
cout << inf_dbl << "\n";
cout << -inf_dbl << "\n";
cout << nan_dbl << "\n";
cout << -nan_dbl << "\n";
}C:\Temp>cl /EHsc /nologo /W4 /MTd /Od meow.cpp && meow
meow.cpp
setprecision(0) showpoint fixed:
i.nf
-.inf
n.an
-.nan(ind)
And showpos:
+i.nf
-.inf
+n.an
-.nan(ind)
libstdc++ and libc++ behave correctly (note that MSVC's STL has an intentional behavior difference regarding negative NaNs, though): https://godbolt.org/z/MYsPxc98h
Originally reported as DevCom-10512845 / VSO-1917556 / AB#1917556 .
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't workingfixedSomething works now, yay!Something works now, yay!