> func getRandom(_ min: Int, _ max: Int) -> Int {
> let diff = max - min + 1
>
> #if os(Linux)
> return min + Int(random() % diff)
> ...
Implementation detail: non-uniformity mistakes of the past should not be
repeated. http://stackoverflow.com/a/6852396/454544 (Timed out on finding a
better reference.)
--
Peter Dillinger, Ph.D.
Software Engineering Manager, Coverity Analysis, Software Integrity Group |
Synopsys
www.synopsys.com/software
_______________________________________________
swift-evolution mailing list
[email protected]
https://lists.swift.org/mailman/listinfo/swift-evolution