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

Method isIntegral

Utilities/cmjsoncpp/src/lib_json/json_value.cpp:1343–1363  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1341}
1342
1343bool Value::isIntegral() const {
1344 switch (type()) {
1345 case intValue:
1346 case uintValue:
1347 return true;
1348 case realValue:
1349#if defined(JSON_HAS_INT64)
1350 // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a
1351 // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we
1352 // require the value to be strictly less than the limit.
1353 return value_.real_ >= double(minInt64) &&
1354 value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_);
1355#else
1356 return value_.real_ >= minInt && value_.real_ <= maxUInt &&
1357 IsIntegral(value_.real_);
1358#endif // JSON_HAS_INT64
1359 default:
1360 break;
1361 }
1362 return false;
1363}
1364
1365bool Value::isDouble() const {
1366 return type() == intValue || type() == uintValue || type() == realValue;

Callers

nothing calls this directly

Calls 2

IsIntegralFunction · 0.85
typeClass · 0.50

Tested by

no test coverage detected