| 1301 | } |
| 1302 | |
| 1303 | bool Value::isInt64() const { |
| 1304 | #if defined(JSON_HAS_INT64) |
| 1305 | switch (type()) { |
| 1306 | case intValue: |
| 1307 | return true; |
| 1308 | case uintValue: |
| 1309 | return value_.uint_ <= UInt64(maxInt64); |
| 1310 | case realValue: |
| 1311 | // Note that maxInt64 (= 2^63 - 1) is not exactly representable as a |
| 1312 | // double, so double(maxInt64) will be rounded up to 2^63. Therefore we |
| 1313 | // require the value to be strictly less than the limit. |
| 1314 | return value_.real_ >= double(minInt64) && |
| 1315 | value_.real_ < double(maxInt64) && IsIntegral(value_.real_); |
| 1316 | default: |
| 1317 | break; |
| 1318 | } |
| 1319 | #endif // JSON_HAS_INT64 |
| 1320 | return false; |
| 1321 | } |
| 1322 | |
| 1323 | bool Value::isUInt64() const { |
| 1324 | #if defined(JSON_HAS_INT64) |
no test coverage detected