Fixed minor edge case

pull/45/head
Mikunj 6 years ago
parent 640977267e
commit 4e521bba83

@ -18,9 +18,10 @@ private class RNG {
} }
func next() -> Int { func next() -> Int {
let seed = (self.seed * 16807) % 2147483647 // Casting to Int64 incase number goes above Int32
self.seed = seed let seed = (Int64(self.seed) * 16807) % 2147483647
return seed self.seed = Int(seed)
return self.seed
} }
func nextFloat() -> Float { func nextFloat() -> Float {

Loading…
Cancel
Save