mercredi 2 décembre 2020

same Int has different values in Swift, mysterious riddle

with this code :

let rand : Int = Int(arc4random())
NSLog("rand = %d %i %@ \(rand)",rand,rand,String(rand))

I get :

rand = -1954814774 -1954814774 2340152522 2340152522

why all 4 values are not the same ?




Aucun commentaire:

Enregistrer un commentaire