# HG changeset patch # User jbe # Date 1452793939 -3600 # Node ID 4a33becb6f5984595a8a62685cad54af98a74177 # Parent 33d43f5a319bb9b8b007c0caa51dc7df05f04a58 json.export(...): also avoid exponential notation for unsigned 64 bit integers represented as float diff -r 33d43f5a319b -r 4a33becb6f59 libraries/json/json.c --- a/libraries/json/json.c Thu Jan 14 18:43:11 2016 +0100 +++ b/libraries/json/json.c Thu Jan 14 18:52:19 2016 +0100 @@ -1121,8 +1121,8 @@ if (isinf(num)) return luaL_error(L, "JSON export not possible for infinite numbers"); // check if float is integral: if (trunc(num) == num) { - // avoid exponential notation for INT64's represented as float: - if (fabs(num) < 1e19) { + // avoid exponential notation for (unsigned) 64 bit integers represented as float: + if (fabs(num) < 1e20) { // use decimal notation: sprintf(numstr, "%.0f", num); } else {