xref: /csrg-svn/usr.bin/f77/libF77/range.c (revision 47940)
1*47940Sbostic /*-
2*47940Sbostic  * Copyright (c) 1980 The Regents of the University of California.
3*47940Sbostic  * All rights reserved.
4*47940Sbostic  *
5*47940Sbostic  * %sccs.include.proprietary.c%
6*47940Sbostic  */
7*47940Sbostic 
8*47940Sbostic #ifndef lint
9*47940Sbostic static char sccsid[] = "@(#)range.c	5.5 (Berkeley) 04/12/91";
10*47940Sbostic #endif /* not lint */
11*47940Sbostic 
123558Sdlw /*
133558Sdlw  * routines to return extreme values
143558Sdlw  * VERY MACHINE DEPENDENT
153558Sdlw  */
163558Sdlw 
173558Sdlw union fi
183558Sdlw {	float	f;
193558Sdlw 	long	i;
203558Sdlw } ;
213558Sdlw 
223558Sdlw union dj
233558Sdlw {	double	d;
243558Sdlw 	long	j[2];
253558Sdlw } ;
263558Sdlw 
273558Sdlw float
flmax_()283558Sdlw flmax_()
293558Sdlw {
303558Sdlw 	union fi n;
318946Sdlw #if	pdp11
323558Sdlw 	n.i = 0x7fffffffL;
338946Sdlw #else	pdp11
348946Sdlw #if	vax
353558Sdlw 	n.i = 0xffff7fff;
368946Sdlw #else	vax
3729935Ssam #if	tahoe
3829935Ssam 	n.i = 0x7fffffffL;
3929935Ssam #else	tahoe
4041871Sbostic #if	hp300
4141871Sbostic 	n.i = 0x7fffffffL;
4241871Sbostic #else	hp300
438946Sdlw 	UNKNOWN MACHINE!
4441871Sbostic #endif	hp300
4529935Ssam #endif	tahoe
468946Sdlw #endif	vax
478946Sdlw #endif	pdp11
483558Sdlw 	return(n.f);
493558Sdlw }
503558Sdlw 
513558Sdlw double
dflmax_()523558Sdlw dflmax_()
533558Sdlw {
543558Sdlw 	union dj n;
558946Sdlw #if	pdp11
563558Sdlw 	n.j[0] = 0x7fffffffL;
573558Sdlw 	n.j[1] = 0xffffffffL;
588946Sdlw #else	pdp11
598946Sdlw #if	vax
603558Sdlw 	n.j[0] = 0xffff7fff;
613558Sdlw 	n.j[1] = 0xffffffff;
628946Sdlw #else	vax
6329935Ssam #if	tahoe
6429935Ssam 	n.j[0] = 0x7fffffffL;
6529935Ssam 	n.j[1] = 0xffffffffL;
6629935Ssam #else	tahoe
6741871Sbostic #if	hp300
6841871Sbostic 	n.j[0] = 0x7fffffffL;
6941871Sbostic 	n.j[1] = 0xffffffffL;
7041871Sbostic #else	hp300
718946Sdlw 	UNKNOWN MACHINE!
7241871Sbostic #endif	hp300
7329935Ssam #endif	tahoe
748946Sdlw #endif	vax
758946Sdlw #endif	pdp11
763558Sdlw 	return(n.d);
773558Sdlw }
783558Sdlw 
793558Sdlw float
flmin_()803558Sdlw flmin_()
813558Sdlw {
823558Sdlw 	union fi n;
838946Sdlw #if	pdp11
843558Sdlw 	n.i = 0x00800000L;
858946Sdlw #else	pdp11
868946Sdlw #if	vax
873558Sdlw 	n.i = 0x00000080;
888946Sdlw #else	vax
8929935Ssam #if	tahoe
9029935Ssam 	n.i = 0x00800000L;
9129935Ssam #else	tahoe
9241871Sbostic #if	hp300
9341871Sbostic 	n.i = 0x00800000L;
9441871Sbostic #else	hp300
958946Sdlw 	UNKNOWN MACHINE!
9641871Sbostic #endif	hp300
9729935Ssam #endif	tahoe
988946Sdlw #endif	vax
998946Sdlw #endif	pdp11
1003558Sdlw 	return(n.f);
1013558Sdlw }
1023558Sdlw 
1033558Sdlw double
dflmin_()1043558Sdlw dflmin_()
1053558Sdlw {
1063558Sdlw 	union dj n;
1078946Sdlw #if	pdp11
1083558Sdlw 	n.j[0] = 0x00800000L;
1093558Sdlw 	n.j[1] = 0;
1108946Sdlw #else	pdp11
1118946Sdlw #if	vax
1123558Sdlw 	n.j[0] = 0x00000080;
1133558Sdlw 	n.j[1] = 0;
1148946Sdlw #else	vax
11529935Ssam #if	tahoe
11629935Ssam 	n.j[0] = 0x00800000L;
11729935Ssam 	n.j[1] = 0;
11829935Ssam #else	tahoe
11941871Sbostic #if	hp300
12041871Sbostic 	n.j[0] = 0x00800000L;
12141871Sbostic 	n.j[1] = 0;
12241871Sbostic #else	hp300
1238946Sdlw 	UNKNOWN MACHINE!
12441871Sbostic #endif	hp300
12529935Ssam #endif	tahoe
1268946Sdlw #endif	vax
1278946Sdlw #endif	pdp11
1283558Sdlw 	return(n.d);
1293558Sdlw }
1303558Sdlw 
1313558Sdlw long int
inmax_()1323558Sdlw inmax_()
1333558Sdlw {
1348946Sdlw 	return(0x7fffffffL);
1353558Sdlw }
1363558Sdlw 
1378946Sdlw 
1388946Sdlw float
ffrac_()1398946Sdlw ffrac_()
1408946Sdlw {
1418946Sdlw 	union fi n;
1428946Sdlw #if	pdp11
1438946Sdlw 	n.i = 0x35000000L;
1448946Sdlw #else	pdp11
1458946Sdlw #if	vax
1468946Sdlw 	n.i = 0x00003500;
1478946Sdlw #else	vax
14829935Ssam #if	tahoe
14929935Ssam 	n.i = 0x35000000L;
15029935Ssam #else	tahoe
15141871Sbostic #if	hp300
15241871Sbostic 	n.i = 0x35000000L;
15341871Sbostic #else	hp300
1548946Sdlw 	UNKNOWN MACHINE!
15541871Sbostic #endif	hp300
15629935Ssam #endif	tahoe
1578946Sdlw #endif	vax
1588946Sdlw #endif	pdp11
1598946Sdlw 	return(n.f);
1608946Sdlw }
1618946Sdlw 
1628946Sdlw double
dffrac_()1638946Sdlw dffrac_()
1648946Sdlw {
1658946Sdlw 	union dj n;
1668946Sdlw #if	pdp11
1678946Sdlw 	n.j[0] = 0x25000000L;
1688946Sdlw 	n.j[1] = 0;
1698946Sdlw #else	pdp11
1708946Sdlw #if	vax
1718946Sdlw 	n.j[0] = 0x00002500;
1728946Sdlw 	n.j[1] = 0;
1738946Sdlw #else	vax
17429935Ssam #if	tahoe
17529935Ssam 	n.j[0] = 0x25000000L;
17629935Ssam 	n.j[1] = 0;
17729935Ssam #else	tahoe
17841871Sbostic #if	hp300
17941871Sbostic 	n.j[0] = 0x25000000L;
18041871Sbostic 	n.j[1] = 0;
18141871Sbostic #else	hp300
1828946Sdlw 	UNKNOWN MACHINE!
18341871Sbostic #endif	hp300
18429935Ssam #endif	tahoe
1858946Sdlw #endif	vax
1868946Sdlw #endif	pdp11
1878946Sdlw 	return(n.d);
1888946Sdlw }
189