iOS Gaussian distribution of random numbers [duplicate]
问题 This question already has an answer here : Closed 7 years ago . Possible Duplicate: Generating a random Gaussian double in Objective-C/C Is there any way of getting a random number not from a uniform distribution, but from a Gaussian (Normal, Bell Curve) distribution in iOS? All the random number generators I have found are basically uniform and I want to make the numbers cluster around a certain point. Thanks! 回答1: Just use a uniform distribution generator and apply the Box-Muller Transform: