| 3779 | } |
| 3780 | |
| 3781 | bool Value::isIntegral() const { |
| 3782 | switch (type()) { |
| 3783 | case intValue: |
| 3784 | case uintValue: |
| 3785 | return true; |
| 3786 | case realValue: |
| 3787 | #if defined(JSON_HAS_INT64) |
| 3788 | // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a |
| 3789 | // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we |
| 3790 | // require the value to be strictly less than the limit. |
| 3791 | return value_.real_ >= double(minInt64) && |
| 3792 | value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_); |
| 3793 | #else |
| 3794 | return value_.real_ >= minInt && value_.real_ <= maxUInt && |
| 3795 | IsIntegral(value_.real_); |
| 3796 | #endif // JSON_HAS_INT64 |
| 3797 | default: |
| 3798 | break; |
| 3799 | } |
| 3800 | return false; |
| 3801 | } |
| 3802 | |
| 3803 | bool Value::isDouble() const { |
| 3804 | return type() == intValue || type() == uintValue || type() == realValue; |
nothing calls this directly
no test coverage detected