MCPcopy Create free account
hub / github.com/PlayFab/gsdk / isIntegral

Method isIntegral

cpp/cppsdk/jsoncpp.cpp:3878–3898  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 1

IsIntegralFunction · 0.85

Tested by

no test coverage detected