|
Quick problem, quick answer, please..!
- The Goblin (madgob@aol.com)
((rand () % 400) / 1000) will always yield 0.
Try this:
(((float) (rand () % 400)) / 1000.f)
Try this:
(((float) (rand () % 400)) / 1000.f)
*grin*
Thanks!
Amazingly, I was actually able to insert the (float) typecast into enough random places to come out with that exact answer, but I appreciate it, thanks!
Learn something new every day.
I wonder how I would prevent the answer from going more than two decimal places...
-----------------
The Goblin
-----------------
"Oh, God..."
"Yes?" <- My Response
Thanks!
Amazingly, I was actually able to insert the (float) typecast into enough random places to come out with that exact answer, but I appreciate it, thanks!
Learn something new every day.
I wonder how I would prevent the answer from going more than two decimal places...
-----------------
The Goblin
-----------------
"Oh, God..."
"Yes?" <- My Response
- The Goblin (madgob@aol.com)
This topic is closed to new replies.
Advertisement
Popular Topics
Advertisement
Recommended Tutorials
Advertisement