xref: /original-bsd/usr.bin/f77/libF77/range.c (revision 264c46cb)
1 /*
2 char id_range[] = "@(#)range.c	1.2";
3  *
4  * routines to return extreme values
5  * VERY MACHINE DEPENDENT
6  */
7 
8 union fi
9 {	float	f;
10 	long	i;
11 } ;
12 
13 union dj
14 {	double	d;
15 	long	j[2];
16 } ;
17 
18 float
19 flmax_()
20 {
21 	union fi n;
22 #if	pdp11
23 	n.i = 0x7fffffffL;
24 #else	pdp11
25 #if	vax
26 	n.i = 0xffff7fff;
27 #else	vax
28 	UNKNOWN MACHINE!
29 #endif	vax
30 #endif	pdp11
31 	return(n.f);
32 }
33 
34 double
35 dflmax_()
36 {
37 	union dj n;
38 #if	pdp11
39 	n.j[0] = 0x7fffffffL;
40 	n.j[1] = 0xffffffffL;
41 #else	pdp11
42 #if	vax
43 	n.j[0] = 0xffff7fff;
44 	n.j[1] = 0xffffffff;
45 #else	vax
46 	UNKNOWN MACHINE!
47 #endif	vax
48 #endif	pdp11
49 	return(n.d);
50 }
51 
52 float
53 flmin_()
54 {
55 	union fi n;
56 #if	pdp11
57 	n.i = 0x00800000L;
58 #else	pdp11
59 #if	vax
60 	n.i = 0x00000080;
61 #else	vax
62 	UNKNOWN MACHINE!
63 #endif	vax
64 #endif	pdp11
65 	return(n.f);
66 }
67 
68 double
69 dflmin_()
70 {
71 	union dj n;
72 #if	pdp11
73 	n.j[0] = 0x00800000L;
74 	n.j[1] = 0;
75 #else	pdp11
76 #if	vax
77 	n.j[0] = 0x00000080;
78 	n.j[1] = 0;
79 #else	vax
80 	UNKNOWN MACHINE!
81 #endif	vax
82 #endif	pdp11
83 	return(n.d);
84 }
85 
86 long int
87 inmax_()
88 {
89 	return(0x7fffffffL);
90 }
91 
92 
93 float
94 ffrac_()
95 {
96 	union fi n;
97 #if	pdp11
98 	n.i = 0x35000000L;
99 #else	pdp11
100 #if	vax
101 	n.i = 0x00003500;
102 #else	vax
103 	UNKNOWN MACHINE!
104 #endif	vax
105 #endif	pdp11
106 	return(n.f);
107 }
108 
109 double
110 dffrac_()
111 {
112 	union dj n;
113 #if	pdp11
114 	n.j[0] = 0x25000000L;
115 	n.j[1] = 0;
116 #else	pdp11
117 #if	vax
118 	n.j[0] = 0x00002500;
119 	n.j[1] = 0;
120 #else	vax
121 	UNKNOWN MACHINE!
122 #endif	vax
123 #endif	pdp11
124 	return(n.d);
125 }
126