Commit 68980887 authored by Guolin Ke's avatar Guolin Ke Committed by GitHub
Browse files

fix RandInt32 .

parent 339915ba
...@@ -95,12 +95,12 @@ public: ...@@ -95,12 +95,12 @@ public:
private: private:
inline int RandInt16() { inline int RandInt16() {
x = (214013 * x + 2531011); x = (214013 * x + 2531011);
return (x >> 16) & 0x7FFF; return static_cast<int>((x >> 16) & 0x7FFF);
} }
inline int RandInt32() { inline int RandInt32() {
x = (214013 * x + 2531011); x = (214013 * x + 2531011);
return x & 0x7FFFFFF; return static_cast<int>(x & 0x7FFFFFFF);
} }
unsigned int x = 123456789; unsigned int x = 123456789;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment