1 /****************************************************************
2 Copyright (C) 1997, 2000 Lucent Technologies
3 All Rights Reserved
4 
5 Permission to use, copy, modify, and distribute this software and
6 its documentation for any purpose and without fee is hereby
7 granted, provided that the above copyright notice appear in all
8 copies and that both that the copyright notice and this
9 permission notice and warranty disclaimer appear in supporting
10 documentation, and that the name of Lucent or any of its entities
11 not be used in advertising or publicity pertaining to
12 distribution of the software without specific, written prior
13 permission.
14 
15 LUCENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
16 INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS.
17 IN NO EVENT SHALL LUCENT OR ANY OF ITS ENTITIES BE LIABLE FOR ANY
18 SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
19 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
20 IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
21 ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
22 THIS SOFTWARE.
23 ****************************************************************/
24 
25 /* machine-dependent initializations */
26 
27 #include "arith.h"
28 #include "math.h"
29 
30 #ifndef Long
31 #define Long long
32 #endif
33 
34 double Infinity, negInfinity;
35 #ifdef __cplusplus
36 extern "C" void Mach_ASL();
37 #endif
38 #ifdef KR_headers
39 #define Void /*void*/
40 #else
41 #define Void void
42 #endif
43 
44  void
Mach_ASL(Void)45 Mach_ASL(Void)
46 {
47 #ifdef IEEE_8087
48 	union {
49 		double d;
50 		Long L[2];
51 		} u;
52 	u.L[1] = 0x7ff00000;
53 	u.L[0] = 0;
54 	Infinity = u.d;
55 /* would use #elif defined, but MIPS doesn't understand #elif */
56 #else
57 #ifdef IEEE_MC68k
58 	union {
59 		double d;
60 		Long L[2];
61 		} u;
62 	u.L[0] = 0x7ff00000;
63 	u.L[1] = 0;
64 	Infinity = u.d;
65 #else
66 #ifdef HUGE_VAL
67 	Infinity = HUGE_VAL;
68 #else
69 #ifdef HUGE
70 #ifdef CRAY
71 	Infinity = 0.5 * HUGE;
72 	/* brain-damaged machine dies testing if (HUGE > -HUGE) */
73 #else
74 	Infinity = HUGE;
75 #endif
76 #else
77 	Cannot define Infinity!!!
78 #endif
79 #endif
80 #endif
81 #endif
82 	negInfinity = -Infinity;
83 	}
84