1117395Skan/* Copyright (C) 2002 Free Software Foundation, Inc. 2117395Skan 3132718SkanThis file is part of GCC. 4117395Skan 5132718SkanGCC is free software; you can redistribute it and/or modify 6117395Skanit under the terms of the GNU General Public License as published by 7117395Skanthe Free Software Foundation; either version 2, or (at your option) 8117395Skanany later version. 9117395Skan 10132718SkanGCC is distributed in the hope that it will be useful, 11117395Skanbut WITHOUT ANY WARRANTY; without even the implied warranty of 12117395SkanMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13117395SkanGNU General Public License for more details. 14117395Skan 15117395SkanYou should have received a copy of the GNU General Public License 16132718Skanalong with GCC; see the file COPYING. If not, write to 17169689Skanthe Free Software Foundation, 51 Franklin Street, Fifth Floor, 18169689SkanBoston, MA 02110-1301, USA. */ 19117395Skan 20117395Skan/* As a special exception, if you include this header file into source 21117395Skan files compiled by GCC, this header file does not by itself cause 22117395Skan the resulting executable to be covered by the GNU General Public 23117395Skan License. This exception does not however invalidate any other 24117395Skan reasons why the executable file might be covered by the GNU General 25117395Skan Public License. */ 26117395Skan 27117395Skan/* 28117395Skan * ISO C Standard: 5.2.4.2.2 Characteristics of floating types <float.h> 29117395Skan */ 30117395Skan 31117395Skan#ifndef _FLOAT_H___ 32117395Skan#define _FLOAT_H___ 33117395Skan 34117395Skan/* Radix of exponent representation, b. */ 35117395Skan#undef FLT_RADIX 36117395Skan#define FLT_RADIX __FLT_RADIX__ 37117395Skan 38117395Skan/* Number of base-FLT_RADIX digits in the significand, p. */ 39117395Skan#undef FLT_MANT_DIG 40117395Skan#undef DBL_MANT_DIG 41117395Skan#undef LDBL_MANT_DIG 42117395Skan#define FLT_MANT_DIG __FLT_MANT_DIG__ 43117395Skan#define DBL_MANT_DIG __DBL_MANT_DIG__ 44117395Skan#define LDBL_MANT_DIG __LDBL_MANT_DIG__ 45117395Skan 46117395Skan/* Number of decimal digits, q, such that any floating-point number with q 47117395Skan decimal digits can be rounded into a floating-point number with p radix b 48117395Skan digits and back again without change to the q decimal digits, 49117395Skan 50117395Skan p * log10(b) if b is a power of 10 51117395Skan floor((p - 1) * log10(b)) otherwise 52117395Skan*/ 53117395Skan#undef FLT_DIG 54117395Skan#undef DBL_DIG 55117395Skan#undef LDBL_DIG 56117395Skan#define FLT_DIG __FLT_DIG__ 57117395Skan#define DBL_DIG __DBL_DIG__ 58117395Skan#define LDBL_DIG __LDBL_DIG__ 59117395Skan 60117395Skan/* Minimum int x such that FLT_RADIX**(x-1) is a normalized float, emin */ 61117395Skan#undef FLT_MIN_EXP 62117395Skan#undef DBL_MIN_EXP 63117395Skan#undef LDBL_MIN_EXP 64117395Skan#define FLT_MIN_EXP __FLT_MIN_EXP__ 65117395Skan#define DBL_MIN_EXP __DBL_MIN_EXP__ 66117395Skan#define LDBL_MIN_EXP __LDBL_MIN_EXP__ 67117395Skan 68117395Skan/* Minimum negative integer such that 10 raised to that power is in the 69117395Skan range of normalized floating-point numbers, 70117395Skan 71117395Skan ceil(log10(b) * (emin - 1)) 72117395Skan*/ 73117395Skan#undef FLT_MIN_10_EXP 74117395Skan#undef DBL_MIN_10_EXP 75117395Skan#undef LDBL_MIN_10_EXP 76117395Skan#define FLT_MIN_10_EXP __FLT_MIN_10_EXP__ 77117395Skan#define DBL_MIN_10_EXP __DBL_MIN_10_EXP__ 78117395Skan#define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__ 79117395Skan 80117395Skan/* Maximum int x such that FLT_RADIX**(x-1) is a representable float, emax. */ 81117395Skan#undef FLT_MAX_EXP 82117395Skan#undef DBL_MAX_EXP 83117395Skan#undef LDBL_MAX_EXP 84117395Skan#define FLT_MAX_EXP __FLT_MAX_EXP__ 85117395Skan#define DBL_MAX_EXP __DBL_MAX_EXP__ 86117395Skan#define LDBL_MAX_EXP __LDBL_MAX_EXP__ 87117395Skan 88117395Skan/* Maximum integer such that 10 raised to that power is in the range of 89117395Skan representable finite floating-point numbers, 90117395Skan 91117395Skan floor(log10((1 - b**-p) * b**emax)) 92117395Skan*/ 93117395Skan#undef FLT_MAX_10_EXP 94117395Skan#undef DBL_MAX_10_EXP 95117395Skan#undef LDBL_MAX_10_EXP 96117395Skan#define FLT_MAX_10_EXP __FLT_MAX_10_EXP__ 97117395Skan#define DBL_MAX_10_EXP __DBL_MAX_10_EXP__ 98117395Skan#define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__ 99117395Skan 100117395Skan/* Maximum representable finite floating-point number, 101117395Skan 102117395Skan (1 - b**-p) * b**emax 103117395Skan*/ 104117395Skan#undef FLT_MAX 105117395Skan#undef DBL_MAX 106117395Skan#undef LDBL_MAX 107117395Skan#define FLT_MAX __FLT_MAX__ 108117395Skan#define DBL_MAX __DBL_MAX__ 109117395Skan#define LDBL_MAX __LDBL_MAX__ 110117395Skan 111117395Skan/* The difference between 1 and the least value greater than 1 that is 112117395Skan representable in the given floating point type, b**1-p. */ 113117395Skan#undef FLT_EPSILON 114117395Skan#undef DBL_EPSILON 115117395Skan#undef LDBL_EPSILON 116117395Skan#define FLT_EPSILON __FLT_EPSILON__ 117117395Skan#define DBL_EPSILON __DBL_EPSILON__ 118117395Skan#define LDBL_EPSILON __LDBL_EPSILON__ 119117395Skan 120117395Skan/* Minimum normalized positive floating-point number, b**(emin - 1). */ 121117395Skan#undef FLT_MIN 122117395Skan#undef DBL_MIN 123117395Skan#undef LDBL_MIN 124117395Skan#define FLT_MIN __FLT_MIN__ 125117395Skan#define DBL_MIN __DBL_MIN__ 126117395Skan#define LDBL_MIN __LDBL_MIN__ 127117395Skan 128117395Skan/* Addition rounds to 0: zero, 1: nearest, 2: +inf, 3: -inf, -1: unknown. */ 129117395Skan/* ??? This is supposed to change with calls to fesetround in <fenv.h>. */ 130117395Skan#undef FLT_ROUNDS 131117395Skan#define FLT_ROUNDS 1 132117395Skan 133117395Skan#if defined (__STDC_VERSION__) && __STDC_VERSION__ >= 199901L 134117395Skan/* The floating-point expression evaluation method. 135117395Skan -1 indeterminate 136117395Skan 0 evaluate all operations and constants just to the range and 137117395Skan precision of the type 138117395Skan 1 evaluate operations and constants of type float and double 139117395Skan to the range and precision of the double type, evaluate 140117395Skan long double operations and constants to the range and 141117395Skan precision of the long double type 142117395Skan 2 evaluate all operations and constants to the range and 143117395Skan precision of the long double type 144117395Skan 145117395Skan ??? This ought to change with the setting of the fp control word; 146117395Skan the value provided by the compiler assumes the widest setting. */ 147117395Skan#undef FLT_EVAL_METHOD 148117395Skan#define FLT_EVAL_METHOD __FLT_EVAL_METHOD__ 149117395Skan 150117395Skan/* Number of decimal digits, n, such that any floating-point number in the 151117395Skan widest supported floating type with pmax radix b digits can be rounded 152117395Skan to a floating-point number with n decimal digits and back again without 153117395Skan change to the value, 154117395Skan 155117395Skan pmax * log10(b) if b is a power of 10 156117395Skan ceil(1 + pmax * log10(b)) otherwise 157117395Skan*/ 158117395Skan#undef DECIMAL_DIG 159117395Skan#define DECIMAL_DIG __DECIMAL_DIG__ 160117395Skan 161117395Skan#endif /* C99 */ 162117395Skan#endif /* _FLOAT_H___ */ 163