Back to index

glibc  2.9
huge_vall.h
Go to the documentation of this file.
00001 /* `HUGE_VALL' constant for ia64 (where it is infinity).
00002    Used by <stdlib.h> and <math.h> functions for overflow.
00003    Copyright (C) 2000, 2004 Free Software Foundation, Inc.
00004    This file is part of the GNU C Library.
00005 
00006    The GNU C Library is free software; you can redistribute it and/or
00007    modify it under the terms of the GNU Lesser General Public
00008    License as published by the Free Software Foundation; either
00009    version 2.1 of the License, or (at your option) any later version.
00010 
00011    The GNU C Library is distributed in the hope that it will be useful,
00012    but WITHOUT ANY WARRANTY; without even the implied warranty of
00013    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00014    Lesser General Public License for more details.
00015 
00016    You should have received a copy of the GNU Lesser General Public
00017    License along with the GNU C Library; if not, write to the Free
00018    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
00019    02111-1307 USA.  */
00020 
00021 #ifndef _MATH_H
00022 # error "Never use <bits/huge_vall.h> directly; include <math.h> instead."
00023 #endif
00024 
00025 #if __GNUC_PREREQ(3,3)
00026 # define HUGE_VALL   (__builtin_huge_vall())
00027 #elif __GNUC_PREREQ(2,96)
00028 # define HUGE_VALL   (__extension__ 0x1.0p32767L)
00029 #else
00030 
00031 # define __HUGE_VALL_bytes  { 0,0,0,0,0,0,0, 0x80, 0xff, 0x7f, 0,0,0,0,0,0}
00032 
00033 # define __huge_vall_t      union { unsigned char __c[16]; long double __ld; }
00034 # ifdef __GNUC__
00035 #  define HUGE_VALL  (__extension__ \
00036                       ((__huge_vall_t) { __c: __HUGE_VALL_bytes }).__ld)
00037 # else /* Not GCC.  */
00038 static __huge_vall_t __huge_vall = { __HUGE_VALL_bytes };
00039 #  define HUGE_VALL  (__huge_vall.__ld)
00040 # endif /* GCC.  */
00041 
00042 #endif /* GCC 2.95 */