In the playground, I'm trying to generate random numbers for a normal distribution using the following code:
import UIKit
import GameplayKit
var mu: Double = 0
var random: Double = 0
for i in 1...1000 {
let random = GKRandomSource()
mu = GKGaussianDistribution(randomSource: random, mean: Float(0.0), distribution: Float(1.0))
print(mu)
}
This will not compile, I get the following error message: "Argument labels '(randomSource:, mean:, distribution:)' do not match any available overloads"
What does this mean and how can I correct the code?
Aucun commentaire:
Enregistrer un commentaire