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

Popular posts from this blog

matlab - error with cyclic autocorrelation function -

django - (fields.E300) Field defines a relation with model 'AbstractEmailUser' which is either not installed, or is abstract -

c# - What is a good .Net RefEdit control to use with ExcelDna? -