MCPcopy Create free account
hub / github.com/deathkiller/jazz2-native / InRange

Function InRange

Sources/Dependencies/jsoncpp/value.cpp:81–86  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

79#if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
80 template <typename T, typename U>
81 static inline bool InRange(double d, T min, U max) {
82 // The casts can lose precision, but we are looking only for
83 // an approximate range. Might fail on edge cases though. ~cdunn
84 return d >= static_cast<double>(min) && d <= static_cast<double>(max) &&
85 !(static_cast<U>(d) == min && d != static_cast<double>(min));
86 }
87#else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION)
88 static inline double integerToDouble(Json::UInt64 value) {
89 return static_cast<double>(Int64(value / 2)) * 2.0 +

Callers 6

asIntMethod · 0.85
asUIntMethod · 0.85
getMethod · 0.85
asInt64Method · 0.85
asUInt64Method · 0.85
isConvertibleToMethod · 0.85

Calls 1

integerToDoubleFunction · 0.85

Tested by

no test coverage detected