【发布时间】:2011-08-28 14:08:16
【问题描述】:
可能的重复:
Generating Random Numbers in Objective-C
What's the most optimal way to get a random floatingpoint number between floatA and floatB?
嗨,
我想生成一个随机浮点数,比如
float scale = randFloat(0.5f, 2.0f);
如何在 Objective-c 中做到这一点?
【问题讨论】:
-
这个答案对我没有帮助!
-
也许你能解释一下为什么......
-
可能是因为答案是返回一个 int。
标签: objective-c