-
Notifications
You must be signed in to change notification settings - Fork 1.6k
Closed
Labels
LWGLibrary Working Group issueLibrary Working Group issuefixedSomething works now, yay!Something works now, yay!
Description
LWG-2381 Inconsistency in parsing floating point numbers
C:\Temp>type meow.cpp
#include <cassert>
#include <cstdlib>
#include <sstream>
bool test(const char* const str, const double correct) {
const double dbl1 = std::strtod(str, nullptr);
assert(dbl1 == correct);
std::istringstream iss(str);
double dbl2 = 0.0;
iss >> dbl2;
return dbl2 == correct;
}
int main() {
assert(test("1.0123456789e+5", 0x1.8b7291613d31cp+16));
assert(test("0x1.01234567p+5", 0x1.01234567p+5));
assert(test("0x1.89abcdefp-5", 0x1.89abcdefp-5));
}C:\Temp>cl /EHsc /nologo /W4 /MTd meow.cpp && meow
meow.cpp
Assertion failed: test("0x1.01234567p+5", 0x1.01234567p+5), file meow.cpp, line 17
This was voted into the Working Paper in October 2021, see #2236.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
LWGLibrary Working Group issueLibrary Working Group issuefixedSomething works now, yay!Something works now, yay!
Type
Projects
Status
Done