10 |
|
|
11 |
|
#include <stdio.h> |
12 |
|
|
13 |
+ |
#ifndef frexp |
14 |
+ |
extern double frexp(); |
15 |
+ |
#endif |
16 |
+ |
#ifndef ldexp |
17 |
+ |
extern double ldexp(); |
18 |
+ |
#endif |
19 |
|
|
20 |
+ |
|
21 |
|
putstr(s, fp) /* write null-terminated string to fp */ |
22 |
|
register char *s; |
23 |
|
register FILE *fp; |
34 |
|
register FILE *fp; |
35 |
|
{ |
36 |
|
while (siz--) |
37 |
< |
putc(i>>(siz<<3) & 0xff, fp); |
37 |
> |
putc((int)(i>>(siz<<3) & 0xff), fp); |
38 |
|
} |
39 |
|
|
40 |
|
|
41 |
|
putflt(f, fp) /* put out floating point number */ |
42 |
< |
double f; |
42 |
> |
double f; |
43 |
> |
FILE *fp; |
44 |
|
{ |
37 |
– |
extern double frexp(); |
45 |
|
int e; |
46 |
|
|
47 |
|
putint((long)(frexp(f,&e)*0x7fffffff), 4, fp); |
91 |
|
getflt(fp) /* get a floating point number */ |
92 |
|
FILE *fp; |
93 |
|
{ |
94 |
< |
extern double ldexp(); |
88 |
< |
double d; |
94 |
> |
double d; |
95 |
|
|
96 |
|
d = (double)getint(4, fp)/0x7fffffff; |
97 |
|
return(ldexp(d, (int)getint(1, fp))); |