From 33e4f02ee2586493480d1f19f34842bd6987107d Mon Sep 17 00:00:00 2001 From: xiaox0321 Date: Tue, 3 Jan 2017 18:29:32 +0800 Subject: [PATCH] Update 22_Protocols.md (#679) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 官方文档的写法是这样的 --- source/chapter2/22_Protocols.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/chapter2/22_Protocols.md b/source/chapter2/22_Protocols.md index cd3b1779..2c119533 100644 --- a/source/chapter2/22_Protocols.md +++ b/source/chapter2/22_Protocols.md @@ -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 } }