1 /* `HUGE_VAL' constants for m68k (where it is infinity).
2 Used by <stdlib.h> and <math.h> functions for overflow.
3 Copyright (C) 1992, 1995, 1996, 1997, 1999, 2000 Free Software Foundation, Inc.
4 This file is part of the GNU C Library.
6 The GNU C Library is free software; you can redistribute it and/or
7 modify it under the terms of the GNU Lesser General Public
8 License as published by the Free Software Foundation; either
9 version 2.1 of the License, or (at your option) any later version.
11 The GNU C Library is distributed in the hope that it will be useful,
12 but WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 Lesser General Public License for more details.
16 You should have received a copy of the GNU Lesser General Public
17 License along with the GNU C Library; if not, write to the Free
18 Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
22 # error "Never use <bits/huge_val.h> directly; include <math.h> instead."
27 #include <sys/cdefs.h>
29 /* IEEE positive infinity (-HUGE_VAL is negative infinity). */
33 # if __GNUC_PREREQ(2,96)
35 # define HUGE_VAL (__extension__ 0x1.0p2047)
41 ((union { unsigned long long __l; double __d; }) \
42 { __l: 0x7ff0000000000000ULL }).__d)
48 static union { unsigned char __c
[8]; double __d
; } __huge_val
=
49 { { 0x7f, 0xf0, 0, 0, 0, 0, 0, 0 } };
50 # define HUGE_VAL (__huge_val.__d)
55 /* ISO C 99 extensions: (float) HUGE_VALF and (long double) HUGE_VALL. */
59 # if __GNUC_PREREQ(2,96)
61 # define HUGE_VALF (__extension__ 0x1.0p255f)
62 # define HUGE_VALL (__extension__ 0x1.0p32767L)
70 ((union { unsigned long __l; float __f; }) \
71 { __l: 0x7f800000UL }).__f)
75 ((union { unsigned long __l[3]; long double __ld; }) \
76 { __l: { 0x7fff0000UL, 0x80000000UL, 0UL } }).__ld)
80 static union { unsigned char __c
[4]; float __f
; } __huge_valf
=
81 { { 0x7f, 0x80, 0, 0 } };
82 # define HUGE_VALF (__huge_valf.__f)
84 static union { unsigned char __c
[12]; long double __ld
; } __huge_vall
=
85 { { 0x7f, 0xff, 0, 0, 0x80, 0, 0, 0, 0, 0, 0, 0 } };
86 # define HUGE_VALL (__huge_vall.__ld)
90 # endif /* GCC 2.95. */
92 #endif /* __USE_ISOC99. */