Path: utzoo!attcan!uunet!cs.utexas.edu!wuarchive!brutus.cs.uiuc.edu!rpi!uupsi!sunic!tut!funet.fi!mea From: mea@funic.funet.fi (Matti E. Aarnio) Newsgroups: comp.unix.i386 Subject: Re: Random numbers problem under Bell Tech. Message-ID: Date: 28 Mar 90 19:18:24 GMT References: <188@hacker.UUCP> Sender: News@tut.fi Organization: Finnish University & Research Network Lines: 33 In-reply-to: steve@hacker.UUCP's message of 24 Mar 90 15:02:14 GMT In article <188@hacker.UUCP> steve@hacker.UUCP (Stephen M. Youndt) writes: Simply put, I compile this: --- main() { int i; srand48(7769); for (i=0; i<20; i++) printf("%g \n", drand48()); } --- run it, get several numbers near to 0 (Ex: 8.32456E-315) then get: --- Floating exception - core dumped --- This is on Bell Tech SV3.2u with the BT S/W Dev Platform. What the hell am I doing wrong, and how do I fix it. Please mail answers directly to me. Thanks in advance. -- SMY -- Stephen M. Youndt | "By the time that we realize that ignorance "Hacker at Large" | truely is bliss, it's already too late" -- ME Its generic C thing. Add there statement telling: double drand48(); Now it should work. Default value function return value is int as you well know... /Matti Aarnio -- Matti E. Aarnio - Finnish University & Research Network project Turku University, WFTL, SF-20500 Turku, Finland - +358-21-6335917 "Virtually, I don't work, I just netWORK :-)"