[comp.sys.amiga] Lattice Question

345EEQX@CMUVM.BITNET (Robert Devantier) (02/03/90)

I tried compiling the following code under Lattice C 5.04 (not a or b)
and every time I run the program, I get a GURU of 4 or B.  Is there
something I am not implementing right, or what?  I compile with the
following command:
1.ram:> lc -Lm test

The code looks like this (just want to print a random number 0<=x<1

/* Test.c - Prints a random number (well, I thought it would!) */
#include <stdio.h>
#include <stdlib.h>
#include <math.h>     /* Required for drand48 */

main()
  { double x = drand48(); printf("The number is: %f.^n",x); }
/* End of Test.c */

I do not call seed48, as page L45 says this "allows initialization of the
internal 48-bit seed to something other than the default", and for right
now the default would be just fine.

Please respond directly to the below address, and I will summarize to
the need is present.

Many thanks to anyone that can help!

-----------------------------------------------------------------
Robert Devantier | 345EEQX@CMUVM.Bitnet | Student Programmer
Central Michigan University | {!Amiga!} | Computer Services
"It doesn't matter what I think, they'll sue me for what I said."