| 3878 | } |
| 3879 | |
| 3880 | bool Value::isIntegral() const { |
| 3881 | switch (type_) { |
| 3882 | case intValue: |
| 3883 | case uintValue: |
| 3884 | return true; |
| 3885 | case realValue: |
| 3886 | #if defined(JSON_HAS_INT64) |
| 3887 | // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a |
| 3888 | // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we |
| 3889 | // require the value to be strictly less than the limit. |
| 3890 | return value_.real_ >= double(minInt64) && |
| 3891 | value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_); |
| 3892 | #else |
| 3893 | return value_.real_ >= minInt && value_.real_ <= maxUInt && |
| 3894 | IsIntegral(value_.real_); |
| 3895 | #endif // JSON_HAS_INT64 |
| 3896 | default: |
| 3897 | break; |
| 3898 | } |
| 3899 | return false; |
| 3900 | } |
| 3901 | |
| 3902 | bool Value::isDouble() const { |
| 3903 | return type_ == intValue || type_ == uintValue || type_ == realValue; |
nothing calls this directly
no test coverage detected