Fix storing nans and infs in preferences in simulator

Turns out file streams cannot parse nans and infs on some platforms, so use std::stof to parse.
This commit is contained in:
Oleg Kalachev 2025-07-14 09:52:49 +03:00
parent e389d717d6
commit 449dd44741

View File

@ -14,10 +14,9 @@ private:
void readFromFile() {
std::ifstream file(storagePath);
std::string key;
float value;
std::string key, value;
while (file >> key >> value) {
storage[key] = value;
storage[key] = std::stof(value); // using stof to support NaN and Infinity
}
}