3 ms·
You are correct. I have just checked my code that I used a couple of years ago to generate random numbers using %. I had the impression back then, when I then s
by LinaLauneBaer 14y ago
You are correct. I have just checked my code that I used a couple of years ago to generate random numbers using %. I had the impression back then, when I then switched to arc4random_uniform that it works much better. It must have been something different or my perception tricks me. Nevertheless not knowing or caring about uniformly distributed random numbers and charging $1000/hours seems a bit strange. One could argue that % needs less CPU cycles but then again: Does this matter? Using arc4random_uniform makes your code much more readable etc. So from a pure code review standpoint of view I would argue that arc4random_uniform should be used if possible. Of course he might also not have used it because of compatibility reasons. Who knows.
Btw: I would like to talk to you in private. How can I contact you?