Changeset View
Changeset View
Standalone View
Standalone View
games/openxcom/files/patch-src_Engine_RNG.cpp
- This file was moved from games/openxcom/files/patch-src__Engine__RNG.cpp.
--- src/Engine/RNG.cpp.orig 2014-06-13 23:14:43.000000000 +0400 | --- src/Engine/RNG.cpp.orig 2014-06-13 19:14:43 UTC | ||||
+++ src/Engine/RNG.cpp 2014-09-11 18:52:08.000000000 +0400 | +++ src/Engine/RNG.cpp | ||||
@@ -17,6 +17,7 @@ | @@ -17,6 +17,7 @@ | ||||
* along with OpenXcom. If not, see <http://www.gnu.org/licenses/>. | * along with OpenXcom. If not, see <http://www.gnu.org/licenses/>. | ||||
*/ | */ | ||||
#include "RNG.h" | #include "RNG.h" | ||||
+#include <limits> | +#include <limits> | ||||
#include <math.h> | #include <math.h> | ||||
#include <time.h> | #include <time.h> | ||||
@@ -86,7 +87,7 @@ | @@ -86,7 +87,7 @@ int generate(int min, int max) | ||||
double generate(double min, double max) | double generate(double min, double max) | ||||
{ | { | ||||
double num = next(); | double num = next(); | ||||
- return (double)(num / ((double)UINT64_MAX / (max - min)) + min); | - return (double)(num / ((double)UINT64_MAX / (max - min)) + min); | ||||
+ return (double)(num / ((double)std::numeric_limits<uint64_t>::max() / (max - min)) + min); | + return (double)(num / ((double)std::numeric_limits<uint64_t>::max() / (max - min)) + min); | ||||
} | } | ||||
/** | /** |