| 2515 | #if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) |
| 2516 | template <typename T, typename U> |
| 2517 | static inline bool InRange(double d, T min, U max) { |
| 2518 | // The casts can lose precision, but we are looking only for |
| 2519 | // an approximate range. Might fail on edge cases though. ~cdunn |
| 2520 | //return d >= static_cast<double>(min) && d <= static_cast<double>(max); |
| 2521 | return d >= min && d <= max; |
| 2522 | } |
| 2523 | #else // if !defined(JSON_USE_INT64_DOUBLE_CONVERSION) |
| 2524 | static inline double integerToDouble(Json::UInt64 value) { |
| 2525 | return static_cast<double>(Int64(value / 2)) * 2.0 + static_cast<double>(Int64(value & 1)); |
no test coverage detected