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
I have a sample json file which has an array of array of array of float weights. {"input_size": 3, "layer_sizes": [2, 2], "weights": [[[0.50, 0.50, 0.50], [0.30, 0.30, 0.30]],[[0.40, 0.40, 0.40], [0.20, 0.20, 0.20]]]}
When I parse json the some of the floating points value show with less precision such as 0.30 is parsed as 0.299999999999
Reproduction steps
` std::ifstream file(fileName);
nlohmann::json data = nlohmann::json::parse(file);
int inputSize = data["input_size"];
std::vector<int> layerSizes = data["layer_sizes"];
auto weights = data["weights"];`
Expected vs. actual results
expected is to have .30 instead of parsing floating point as .29999999999.
Description
I have a sample json file which has an array of array of array of float weights.
{"input_size": 3, "layer_sizes": [2, 2], "weights": [[[0.50, 0.50, 0.50], [0.30, 0.30, 0.30]],[[0.40, 0.40, 0.40], [0.20, 0.20, 0.20]]]}
When I parse json the some of the floating points value show with less precision such as 0.30 is parsed as 0.299999999999
Reproduction steps
` std::ifstream file(fileName);
nlohmann::json data = nlohmann::json::parse(file);
Expected vs. actual results
expected is to have .30 instead of parsing floating point as .29999999999.
Minimal code example
Error messages
No response
Compiler and operating system
VS2017
Library version
3.11.3
Validation
develop
branch is used.The text was updated successfully, but these errors were encountered: