| 1341 | } |
| 1342 | |
| 1343 | bool Value::isIntegral() const { |
| 1344 | switch (type()) { |
| 1345 | case intValue: |
| 1346 | case uintValue: |
| 1347 | return true; |
| 1348 | case realValue: |
| 1349 | #if defined(JSON_HAS_INT64) |
| 1350 | // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a |
| 1351 | // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we |
| 1352 | // require the value to be strictly less than the limit. |
| 1353 | return value_.real_ >= double(minInt64) && |
| 1354 | value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_); |
| 1355 | #else |
| 1356 | return value_.real_ >= minInt && value_.real_ <= maxUInt && |
| 1357 | IsIntegral(value_.real_); |
| 1358 | #endif // JSON_HAS_INT64 |
| 1359 | default: |
| 1360 | break; |
| 1361 | } |
| 1362 | return false; |
| 1363 | } |
| 1364 | |
| 1365 | bool Value::isDouble() const { |
| 1366 | return type() == intValue || type() == uintValue || type() == realValue; |
nothing calls this directly
no test coverage detected