Q:

Why only 0.000000 from psuedo-random number generator?

Why is rand_float only returning the value 0.000000?
#include <stdio.h>
#include <stdlib.h>
#include <time.h>

int main(int test, int numpoints, int numtrials, int dimension){

    //generate a random number
    float r = rand_float();

    //print it
    printf("%f", r);
    printf("\n");
}

//function generates a random float in [0,1]
int rand_float(){
    srand(time(NULL));
    return (float)rand()/RAND_MAX;
}

A:

Note the return type of rand_float is int.
So the [0,1) value (in the float) is being implicitly cast to 0 (an int), which is all that function will ever return.
Fix the return type - by changing it from int to float.
Also, either forward-declare the rand_float function or move the function definition ahead of the main function .. and check out the other comments on your main question. Enable (and read) compiler warnings for hints about [potentially] problematic code!

