I'm having trouble trying to find a way to return a random number between 1 and 9,000,000,000,000,000
I have made a randomNumberBetween function using UInt32 but I just havn't been able to do the same using a UInt64.
I understand arc4random_uniform only uses UInt32. But is there an alternative for UInt64?
Anyone know now?
Thanks for your help!
let min:UInt32 = 1
let max:UInt32 = UINT32_MAX
func randomNumberBetween(min:UInt32, max:UInt32) -> UInt32 {
let randomNumber = arc4random_uniform(max - min) + min
return randomNumber
}
randomNumberBetween(min, max)