--- ray/src/common/portio.c 1992/09/21 12:02:23 2.2 +++ ray/src/common/portio.c 1996/11/15 16:20:35 2.5 @@ -10,7 +10,14 @@ static char SCCSid[] = "$SunId$ LBL"; #include +#ifndef frexp +extern double frexp(); +#endif +#ifndef ldexp +extern double ldexp(); +#endif + putstr(s, fp) /* write null-terminated string to fp */ register char *s; register FILE *fp; @@ -35,7 +42,6 @@ putflt(f, fp) /* put out floating point number */ double f; FILE *fp; { - extern double frexp(); int e; putint((long)(frexp(f,&e)*0x7fffffff), 4, fp); @@ -85,9 +91,10 @@ double getflt(fp) /* get a floating point number */ FILE *fp; { - extern double ldexp(); + long l; double d; - d = (double)getint(4, fp)/0x7fffffff; + l = getint(4, fp); + d = (l + (l > 0 ? .5 : -.5)) * (1./0x7fffffff); return(ldexp(d, (int)getint(1, fp))); }