Java long values ​​rounded in json response

When I receive a JSON response from my restful service implemented in JAVA, I observe that long data type values ​​ending in 01 are rounded to 00. For example:

long values

12345123459876501 is returned as 12345123459876500 (last digit rounded to 0)

12345123459876502 is returned as 12345123459876502

12345123451234501 is returned as 12345123451234500 (last digit rounded to 0)

12345123451234502 is returned as 12345123451234502

Can someone help me understand why only values ​​ending in 01 are rounded to 00?

+4
source share
2 answers

JSON, json.org, , "". JSON Java double , , . , double 15-16 , long . , long , , JSON long double, 01 00. , , String long .

+5

Java BigInteger json.

0

Source: https://habr.com/ru/post/1535784/


All Articles