Index: src/libchcore/MathFunctions.cpp =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r2e4c7ba0816e80183fd5964d0608d53eea415893 --- src/libchcore/MathFunctions.cpp (.../MathFunctions.cpp) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/MathFunctions.cpp (.../MathFunctions.cpp) (revision 2e4c7ba0816e80183fd5964d0608d53eea415893) @@ -11,14 +11,12 @@ if (ullDenominator == 0) return 0.0; - const unsigned long long ullMaxInt32 = (unsigned long long)std::numeric_limits::max(); - while (ullNumber > ullMaxInt32 || ullDenominator > ullMaxInt32) - { - ullNumber >>= 1; - ullDenominator >>= 1; - } + return (double)ullNumber / (double)ullDenominator; + } - return boost::numeric_cast(ullNumber) / boost::numeric_cast(ullDenominator); + LIBCHCORE_API double Div64(unsigned long long ullNumber, double dDenominator) + { + return ullNumber / dDenominator; } } } Index: src/libchcore/MathFunctions.h =================================================================== diff -u -re96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3 -r2e4c7ba0816e80183fd5964d0608d53eea415893 --- src/libchcore/MathFunctions.h (.../MathFunctions.h) (revision e96806b7f8ff7ca7e9f4afbea603e6351a3dc3e3) +++ src/libchcore/MathFunctions.h (.../MathFunctions.h) (revision 2e4c7ba0816e80183fd5964d0608d53eea415893) @@ -26,6 +26,7 @@ namespace Math { LIBCHCORE_API double Div64(unsigned long long ullNumber, unsigned long long ullDenominator); + LIBCHCORE_API double Div64(unsigned long long ullNumber, double dDenominator); } }