You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi, I discovered a potentially serious bug in v1.1. The following code does not correctly scan a negative decimal value:
double scanned;
scn::scan("-1.5036", "{}", scanned);
std::printf("%f\n", scanned);
// prints 1.5036 (without minus sign)
The same goes for:
auto scanned = scn::scan_value<double>("-1.5036");
std::printf("%f\n", scanned.value());
// prints 1.5036 (without minus sign)
I tried using the {:f} format string without improvement. Am I doing something wrong? My current hypothesis is that the minus sign is discarded because it is considered not to be a part of the scanned value. I would appreciate a second opinion.
The text was updated successfully, but these errors were encountered:
If the issue is really only present in v1 with SCN_DISABLE_LOCALE on, I don't think I'll do anything about it myself: I don't really intend to touch v1 anymore. Your hypothesis is likely correct, as SCN_DISABLE_LOCALE isn't and wasn't really tested properly in v1.
Hi, I discovered a potentially serious bug in v1.1. The following code does not correctly scan a negative decimal value:
The same goes for:
I tried using the
{:f}
format string without improvement. Am I doing something wrong? My current hypothesis is that the minus sign is discarded because it is considered not to be a part of the scanned value. I would appreciate a second opinion.The text was updated successfully, but these errors were encountered: