xref: /illumos-gate/usr/src/lib/libc/port/fp/fp_data.c (revision 45ede40b2394db7967e59f19288fae9b62efd4aa)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*	Copyright (c) 1988 AT&T	*/
23 /*	  All Rights Reserved  	*/
24 
25 
26 /*
27  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
28  * Use is subject to license terms.
29  */
30 
31 #pragma ident	"%Z%%M%	%I%	%E% SMI"	/* SVr4.0 1.8	*/
32 
33 /*
34  * contains the definitions
35  * of the global constant __huge_val used
36  * by the floating point environment
37  */
38 
39 /*
40  * XXX - the preferred fix for this sits in delta 1.12.
41  * But the following code is the only way to fix this given the lint and cc
42  * we use now.  Newer compilers and lints should fix this so we can
43  * put delta 1.12 back.  See 6208626.
44  */
45 
46 #include <sys/feature_tests.h>
47 
48 #undef _STDC_C99	/* to force the definition of '_h_val' */
49 #undef __C99FEATURES__	/* to force the definition of '_h_val' */
50 
51 #include <math.h>		/* for '_h_val' */
52 
53 /* IEEE infinity */
54 const _h_val __huge_val =
55 #if defined(_LP64)			/* long == long long */
56 	{ 0x7ff0000000000000ull };
57 #elif defined(_LONG_LONG_HTOL)		/* like 32-bit sparc */
58 	{ 0x7ff00000ul, 0x00000000ul };
59 #elif defined(_LONG_LONG_LTOH)		/* like 32-bit x86 */
60 	{ 0x00000000ul, 0x7ff00000ul };
61 #else
62 #error "none of { _LP64 _LONG_LONG_HTOL _LONG_LONG_LTOH } is defined"
63 #endif
64