MCPcopy Create free account
hub / github.com/SOUI2/soui / isIntegral

Method isIntegral

third-part/jsoncpp/src/lib_json/json_value.cpp:1388–1406  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1386}
1387
1388bool Value::isIntegral() const {
1389 switch (type_) {
1390 case intValue:
1391 case uintValue:
1392 return true;
1393 case realValue:
1394#if defined(JSON_HAS_INT64)
1395 // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a
1396 // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we
1397 // require the value to be strictly less than the limit.
1398 return value_.real_ >= double(minInt64) && value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_);
1399#else
1400 return value_.real_ >= minInt && value_.real_ <= maxUInt && IsIntegral(value_.real_);
1401#endif // JSON_HAS_INT64
1402 default:
1403 break;
1404 }
1405 return false;
1406}
1407
1408bool Value::isDouble() const { return type_ == intValue || type_ == uintValue || type_ == realValue; }
1409

Callers 1

checkIsMethod · 0.80

Calls 1

IsIntegralFunction · 0.85

Tested by

no test coverage detected