Generate a random double between -1 and 1 in Swift -
this 1 should quite simple somehow can't find way this: have random double between -1 , 1.
everything found on internet either integers, 0 1 or didn't work.
i hope of guys can me!
let = (double(arc4random()) / double(uint32.max)) * 2 - 1
ps: use uint32.max swifty code ;)
Comments
Post a Comment