Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!hellgate.utah.edu!helios.ee.lbl.gov!pasteur!ucbvax!hplabs!hpfcso!bruno From: bruno@hpfcso.HP.COM (Bruno Melli) Newsgroups: comp.lang.c Subject: Re: drand48 Message-ID: <7060003@hpfcso.HP.COM> Date: 23 Mar 90 00:44:45 GMT References: <1198@kunivv1.sci.kun.nl> Organization: Hewlett-Packard, Fort Collins, CO, USA Lines: 16 / hpfcso:comp.lang.c / root@kunivv1.sci.kun.nl (Privileged Account) / 6:00 am Mar 21, 1990 / > when we assign the result of the drand48 function to a variable and > print it afterwards, the value printed is not between 0 and 1. > But, when we instead print the result of drand48 directly, the result is > between 0 and 1. make sure you have a line like double drand48(); in your definitions before you call the function. Unless told otherwise the compiler assumes that drand48() returns an int. bruno.