Any ideas?
Any ideas?
"A Programmer being told to 'go to' hell sees the 'go to' part of the sentence as the worst part." - Master Foto
Just an idea:
float f=rand()/100.0;
Hope you don't mind my bad english, I'm Austrian!
This works. I just wrote it now so it isn't the best, plus it is kinda expensive.
[edit]Code:#include <iostream> #include <cstdlib> #include <math.h> #include <time.h> int main(void) { using namespace std; srand(time(NULL)); float r; int i; for(;;) { i = rand(); r = (i-sqrtf(i))/10000; cout << r << endl; } return 0; }
stupid smilies...
[/edit]
Just make a random integer then devide it by another number.
Then you can store it in a float or double...