arc4random随机数生成器 [英] arc4random Random Number Generator

查看:94
本文介绍了arc4random随机数生成器的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

int randomNumber = (arc4random() % 83) + 1;

这是生成最随机数字的最佳方法吗?还是有更好的方法来生成随机数?

Is this the best way to generate "the most random" number? Or is there a better way to generate a random number?

推荐答案

arc4random具有一种基于当前算法生成随机数的高级算法。时间。还有其他的rand函数,但是它们不那么好,需要种子。

arc4random has a superior algorithm for generating random numbers based on the current time. There are other rand functions but they are not as good and require seeding.

这篇关于arc4random随机数生成器的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆