MCPcopy Create free account
hub / github.com/Illumina/paragraph / isIntegral

Method isIntegral

external/jsoncpp/jsoncpp.cpp:3857–3875  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3855}
3856
3857bool Value::isIntegral() const {
3858 switch (type_) {
3859 case intValue:
3860 case uintValue:
3861 return true;
3862 case realValue:
3863#if defined(JSON_HAS_INT64)
3864 // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a
3865 // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we
3866 // require the value to be strictly less than the limit.
3867 return value_.real_ >= double(minInt64) && value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_);
3868#else
3869 return value_.real_ >= minInt && value_.real_ <= maxUInt && IsIntegral(value_.real_);
3870#endif // JSON_HAS_INT64
3871 default:
3872 break;
3873 }
3874 return false;
3875}
3876
3877bool Value::isDouble() const { return type_ == intValue || type_ == uintValue || type_ == realValue; }
3878

Callers

nothing calls this directly

Calls 1

IsIntegralFunction · 0.85

Tested by

no test coverage detected