Can someone provide a way to produce a random float between -Pi/2 and Pi/2 please?
I’ve tried…
float angleR = M_PI / arc4random_uniform(1000) - M_PI * 0.5;
But that doesn’t work, lol.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
You can easily adapt it to use
arc4randfunction (mind that its maximum value should be0x100000000).