xref: /csrg-svn/usr.bin/f77/libF77/range.c (revision 41871)
13558Sdlw /*
222974Skre  * Copyright (c) 1980 Regents of the University of California.
322974Skre  * All rights reserved.  The Berkeley software License Agreement
422974Skre  * specifies the terms and conditions for redistribution.
53558Sdlw  *
6*41871Sbostic  *	@(#)range.c	5.4	05/13/90
723002Skre  *
83558Sdlw  * routines to return extreme values
93558Sdlw  * VERY MACHINE DEPENDENT
103558Sdlw  */
113558Sdlw 
123558Sdlw union fi
133558Sdlw {	float	f;
143558Sdlw 	long	i;
153558Sdlw } ;
163558Sdlw 
173558Sdlw union dj
183558Sdlw {	double	d;
193558Sdlw 	long	j[2];
203558Sdlw } ;
213558Sdlw 
223558Sdlw float
233558Sdlw flmax_()
243558Sdlw {
253558Sdlw 	union fi n;
268946Sdlw #if	pdp11
273558Sdlw 	n.i = 0x7fffffffL;
288946Sdlw #else	pdp11
298946Sdlw #if	vax
303558Sdlw 	n.i = 0xffff7fff;
318946Sdlw #else	vax
3229935Ssam #if	tahoe
3329935Ssam 	n.i = 0x7fffffffL;
3429935Ssam #else	tahoe
35*41871Sbostic #if	hp300
36*41871Sbostic 	n.i = 0x7fffffffL;
37*41871Sbostic #else	hp300
388946Sdlw 	UNKNOWN MACHINE!
39*41871Sbostic #endif	hp300
4029935Ssam #endif	tahoe
418946Sdlw #endif	vax
428946Sdlw #endif	pdp11
433558Sdlw 	return(n.f);
443558Sdlw }
453558Sdlw 
463558Sdlw double
473558Sdlw dflmax_()
483558Sdlw {
493558Sdlw 	union dj n;
508946Sdlw #if	pdp11
513558Sdlw 	n.j[0] = 0x7fffffffL;
523558Sdlw 	n.j[1] = 0xffffffffL;
538946Sdlw #else	pdp11
548946Sdlw #if	vax
553558Sdlw 	n.j[0] = 0xffff7fff;
563558Sdlw 	n.j[1] = 0xffffffff;
578946Sdlw #else	vax
5829935Ssam #if	tahoe
5929935Ssam 	n.j[0] = 0x7fffffffL;
6029935Ssam 	n.j[1] = 0xffffffffL;
6129935Ssam #else	tahoe
62*41871Sbostic #if	hp300
63*41871Sbostic 	n.j[0] = 0x7fffffffL;
64*41871Sbostic 	n.j[1] = 0xffffffffL;
65*41871Sbostic #else	hp300
668946Sdlw 	UNKNOWN MACHINE!
67*41871Sbostic #endif	hp300
6829935Ssam #endif	tahoe
698946Sdlw #endif	vax
708946Sdlw #endif	pdp11
713558Sdlw 	return(n.d);
723558Sdlw }
733558Sdlw 
743558Sdlw float
753558Sdlw flmin_()
763558Sdlw {
773558Sdlw 	union fi n;
788946Sdlw #if	pdp11
793558Sdlw 	n.i = 0x00800000L;
808946Sdlw #else	pdp11
818946Sdlw #if	vax
823558Sdlw 	n.i = 0x00000080;
838946Sdlw #else	vax
8429935Ssam #if	tahoe
8529935Ssam 	n.i = 0x00800000L;
8629935Ssam #else	tahoe
87*41871Sbostic #if	hp300
88*41871Sbostic 	n.i = 0x00800000L;
89*41871Sbostic #else	hp300
908946Sdlw 	UNKNOWN MACHINE!
91*41871Sbostic #endif	hp300
9229935Ssam #endif	tahoe
938946Sdlw #endif	vax
948946Sdlw #endif	pdp11
953558Sdlw 	return(n.f);
963558Sdlw }
973558Sdlw 
983558Sdlw double
993558Sdlw dflmin_()
1003558Sdlw {
1013558Sdlw 	union dj n;
1028946Sdlw #if	pdp11
1033558Sdlw 	n.j[0] = 0x00800000L;
1043558Sdlw 	n.j[1] = 0;
1058946Sdlw #else	pdp11
1068946Sdlw #if	vax
1073558Sdlw 	n.j[0] = 0x00000080;
1083558Sdlw 	n.j[1] = 0;
1098946Sdlw #else	vax
11029935Ssam #if	tahoe
11129935Ssam 	n.j[0] = 0x00800000L;
11229935Ssam 	n.j[1] = 0;
11329935Ssam #else	tahoe
114*41871Sbostic #if	hp300
115*41871Sbostic 	n.j[0] = 0x00800000L;
116*41871Sbostic 	n.j[1] = 0;
117*41871Sbostic #else	hp300
1188946Sdlw 	UNKNOWN MACHINE!
119*41871Sbostic #endif	hp300
12029935Ssam #endif	tahoe
1218946Sdlw #endif	vax
1228946Sdlw #endif	pdp11
1233558Sdlw 	return(n.d);
1243558Sdlw }
1253558Sdlw 
1263558Sdlw long int
1273558Sdlw inmax_()
1283558Sdlw {
1298946Sdlw 	return(0x7fffffffL);
1303558Sdlw }
1313558Sdlw 
1328946Sdlw 
1338946Sdlw float
1348946Sdlw ffrac_()
1358946Sdlw {
1368946Sdlw 	union fi n;
1378946Sdlw #if	pdp11
1388946Sdlw 	n.i = 0x35000000L;
1398946Sdlw #else	pdp11
1408946Sdlw #if	vax
1418946Sdlw 	n.i = 0x00003500;
1428946Sdlw #else	vax
14329935Ssam #if	tahoe
14429935Ssam 	n.i = 0x35000000L;
14529935Ssam #else	tahoe
146*41871Sbostic #if	hp300
147*41871Sbostic 	n.i = 0x35000000L;
148*41871Sbostic #else	hp300
1498946Sdlw 	UNKNOWN MACHINE!
150*41871Sbostic #endif	hp300
15129935Ssam #endif	tahoe
1528946Sdlw #endif	vax
1538946Sdlw #endif	pdp11
1548946Sdlw 	return(n.f);
1558946Sdlw }
1568946Sdlw 
1578946Sdlw double
1588946Sdlw dffrac_()
1598946Sdlw {
1608946Sdlw 	union dj n;
1618946Sdlw #if	pdp11
1628946Sdlw 	n.j[0] = 0x25000000L;
1638946Sdlw 	n.j[1] = 0;
1648946Sdlw #else	pdp11
1658946Sdlw #if	vax
1668946Sdlw 	n.j[0] = 0x00002500;
1678946Sdlw 	n.j[1] = 0;
1688946Sdlw #else	vax
16929935Ssam #if	tahoe
17029935Ssam 	n.j[0] = 0x25000000L;
17129935Ssam 	n.j[1] = 0;
17229935Ssam #else	tahoe
173*41871Sbostic #if	hp300
174*41871Sbostic 	n.j[0] = 0x25000000L;
175*41871Sbostic 	n.j[1] = 0;
176*41871Sbostic #else	hp300
1778946Sdlw 	UNKNOWN MACHINE!
178*41871Sbostic #endif	hp300
17929935Ssam #endif	tahoe
1808946Sdlw #endif	vax
1818946Sdlw #endif	pdp11
1828946Sdlw 	return(n.d);
1838946Sdlw }
184