Quantcast
Channel: WE MOVED to github.com/microsoft/cpprestsdk. This site is not monitored!
Viewing all articles
Browse latest Browse all 4845

Created Unassigned: json::value::parse limits numerics to 32 bit int [72]

$
0
0
json::value::parse of a numeric value is limited to a 32 bit int value. Any number of greater magnitude resolves to -2147483648. Expected behavior is to parse a number as as a double.

I see this report is a variation of a previous report: https://casablanca.codeplex.com/workitem/65

This is a real world problem. I'm blocked from being able to use BestBuy API "productid" property.

```
json::value v1 = json::value::parse(L"{ \"n\": 2147483647 }"); // 2**31-1 returns 2147483647
wcout << v1.to_string() << endl;
json::value v2 = json::value::parse(L"{ \"n\": 2147483648 }"); // 2**31 returns -2147483648
wcout << v2.to_string() << endl;
json::value v3 = json::value::parse(L"{ \"n\": 4294967295 }"); // 2**32-1 returns -2147483648
wcout << v3.to_string() << endl;
json::value v4 = json::value::parse(L"{ \"n\": 4294967296 }"); // 2**32 returns -2147483648
wcout << v4.to_string() << endl;

```

Viewing all articles
Browse latest Browse all 4845

Trending Articles