Random integers

Doug Gwyn gwyn at smoke.BRL.MIL
Sat Mar 18 11:02:07 AEST 1989


In article <2686 at sun.soe.clarkson.edu> tree at sun.soe.clarkson.edu (Tom Emerson) writes:
>int k;
>k = 10 * drand48();
>But to now avail; I get a number that looks similar to 2274665.

Probably your only problem here is that you allowed the compiler to
assume the default value type of int for the drand48() function; you
need to declare that it returns a double.



More information about the Comp.lang.c mailing list