Deal with zero sized ranges in Uniform correctly.

Change-Id: I6d5c622869e4795c252fa5c26fffbe4844abc3c9
This commit is contained in:
Sameer Agarwal
2017-06-11 16:26:23 -07:00
parent 59220af761
commit d90e5a708b
+5 -1
View File
@@ -43,7 +43,11 @@ inline void SetRandomState(int state) {
}
inline int Uniform(int n) {
return rand() % n;
if (n) {
return rand() % n;
} else {
return 0;
}
}
inline double RandDouble() {