--- ray/src/common/hilbert.c 2011/02/18 00:40:25 3.1 +++ ray/src/common/hilbert.c 2011/04/08 23:23:28 3.3 @@ -1,3 +1,6 @@ +#ifndef lint +static const char RCSid[] = "$Id: hilbert.c,v 3.3 2011/04/08 23:23:28 greg Exp $"; +#endif /* See LICENSE below for information on rights to use, modify and distribute this code. */ @@ -22,7 +25,7 @@ * from his, the first two interfaces and the style of some comments are very * much derived from his work. */ - +#include #include "hilbert.h" /* implementation of the hilbert functions */ @@ -1253,9 +1256,10 @@ int main() printf("How many points? "); scanf("%d", &n); a = (double*) malloc(2*n*sizeof(double)); - for (i = 0; i < n; ++i) - a[2*i] = drand48()-0.5, a[2*i+1] = drand48()-0.5; - + for (i = 0; i < n; ++i) { + a[2*i] = rand()*(1./RAND_MAX) - 0.5; + a[2*i+1] = rand()*(1./RAND_MAX) - 0.5; + } qsort(a, n, 2*sizeof(double), cmp); for (i = 0; i < n; ++i)