Update 22_Protocols.md (#679)

官方文档的写法是这样的
This commit is contained in:
xiaox0321
2017-01-03 18:29:32 +08:00
committed by 安正超
parent 1fb769e4df
commit 33e4f02ee2

View File

@ -171,7 +171,7 @@ class LinearCongruentialGenerator: RandomNumberGenerator {
let a = 3877.0
let c = 29573.0
func random() -> Double {
lastRandom = ((lastRandom * a + c) % m)
lastRandom = ((lastRandom * a + c).truncatingRemainder(dividingBy:m))
return lastRandom / m
}
}