• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 219
  • Last Modified:

pseudo-random floating point number generation?

how do i generate pseudo random numbers(floating point) between -10 and 10.
please help, it is urgent.  
0
o_enigma_o
Asked:
o_enigma_o
1 Solution
 
ozoCommented:
#include <stdlib.h>
float r = 20.0*rand()/RAND_MAX-10.0;
0
 
jmcgOwnerCommented:
Nothing has happened on this question in over 9 months. It's time for cleanup!

My recommendation, which I will post in the Cleanup topic area, is to
accept answer by ozo.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

jmcg
EE Cleanup Volunteer
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Tackle projects and never again get stuck behind a technical roadblock.
Join Now