Thanks for the correction. I guess that helps my point, its easy to get this sort of thing wrong, so it would be a good candidate for being included in the standard library.
On Mon, Apr 3, 2017 at 6:53 PM, Peter Dillinger < [email protected]> wrote: > > 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
