MCPcopy Create free account
hub / github.com/ComodoSecurity/openedr / isIntegral

Method isIntegral

edrav2/eprj/jsoncpp/src/lib_json/json_value.cpp:1440–1460  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1438}
1439
1440bool Value::isIntegral() const {
1441 switch (type_) {
1442 case intValue:
1443 case uintValue:
1444 return true;
1445 case realValue:
1446#if defined(JSON_HAS_INT64)
1447 // Note that maxUInt64 (= 2^64 - 1) is not exactly representable as a
1448 // double, so double(maxUInt64) will be rounded up to 2^64. Therefore we
1449 // require the value to be strictly less than the limit.
1450 return value_.real_ >= double(minInt64) &&
1451 value_.real_ < maxUInt64AsDouble && IsIntegral(value_.real_);
1452#else
1453 return value_.real_ >= minInt && value_.real_ <= maxUInt &&
1454 IsIntegral(value_.real_);
1455#endif // JSON_HAS_INT64
1456 default:
1457 break;
1458 }
1459 return false;
1460}
1461
1462bool Value::isDouble() const {
1463 return type_ == intValue || type_ == uintValue || type_ == realValue;

Callers 6

checkIsMethod · 0.80
test_common.cppFile · 0.80
ValidateResponseMethod · 0.80
ValidateRequestFieldsMethod · 0.80
WrapErrorMethod · 0.80

Calls 1

IsIntegralFunction · 0.85

Tested by

no test coverage detected