MCPcopy Create free account
hub / github.com/Kitware/VTK / isIntegral

Method isIntegral

ThirdParty/jsoncpp/vtkjsoncpp/jsoncpp.cpp:3781–3801  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

3779}
3780
3781bool 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
3803bool Value::isDouble() const {
3804 return type() == intValue || type() == uintValue || type() == realValue;

Callers

nothing calls this directly

Calls 2

IsIntegralFunction · 0.70
typeEnum · 0.50

Tested by

no test coverage detected