clang API Documentation

float.h
Go to the documentation of this file.
00001 /*===---- float.h - Characteristics of floating point types ----------------===
00002  *
00003  * Permission is hereby granted, free of charge, to any person obtaining a copy
00004  * of this software and associated documentation files (the "Software"), to deal
00005  * in the Software without restriction, including without limitation the rights
00006  * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
00007  * copies of the Software, and to permit persons to whom the Software is
00008  * furnished to do so, subject to the following conditions:
00009  *
00010  * The above copyright notice and this permission notice shall be included in
00011  * all copies or substantial portions of the Software.
00012  *
00013  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
00014  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
00015  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
00016  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
00017  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
00018  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
00019  * THE SOFTWARE.
00020  *
00021  *===-----------------------------------------------------------------------===
00022  */
00023 
00024 #ifndef __FLOAT_H
00025 #define __FLOAT_H
00026 
00027 /* If we're on MinGW, fall back to the system's float.h, which might have
00028  * additional definitions provided for Windows.
00029  * For more details see http://msdn.microsoft.com/en-us/library/y0ybw9fy.aspx
00030  */
00031 #if (defined(__MINGW32__) || defined(_MSC_VER)) && __STDC_HOSTED__ && \
00032     __has_include_next(<float.h>)
00033 #  include_next <float.h>
00034 
00035 /* Undefine anything that we'll be redefining below. */
00036 #  undef FLT_EVAL_METHOD
00037 #  undef FLT_ROUNDS
00038 #  undef FLT_RADIX
00039 #  undef FLT_MANT_DIG
00040 #  undef DBL_MANT_DIG
00041 #  undef LDBL_MANT_DIG
00042 #  undef DECIMAL_DIG
00043 #  undef FLT_DIG
00044 #  undef DBL_DIG
00045 #  undef LDBL_DIG
00046 #  undef FLT_MIN_EXP
00047 #  undef DBL_MIN_EXP
00048 #  undef LDBL_MIN_EXP
00049 #  undef FLT_MIN_10_EXP
00050 #  undef DBL_MIN_10_EXP
00051 #  undef LDBL_MIN_10_EXP
00052 #  undef FLT_MAX_EXP
00053 #  undef DBL_MAX_EXP
00054 #  undef LDBL_MAX_EXP
00055 #  undef FLT_MAX_10_EXP
00056 #  undef DBL_MAX_10_EXP
00057 #  undef LDBL_MAX_10_EXP
00058 #  undef FLT_MAX
00059 #  undef DBL_MAX
00060 #  undef LDBL_MAX
00061 #  undef FLT_EPSILON
00062 #  undef DBL_EPSILON
00063 #  undef LDBL_EPSILON
00064 #  undef FLT_MIN
00065 #  undef DBL_MIN
00066 #  undef LDBL_MIN
00067 #  if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
00068 #    undef FLT_TRUE_MIN
00069 #    undef DBL_TRUE_MIN
00070 #    undef LDBL_TRUE_MIN
00071 #  endif
00072 #endif
00073 
00074 /* Characteristics of floating point types, C99 5.2.4.2.2 */
00075 
00076 #define FLT_EVAL_METHOD __FLT_EVAL_METHOD__
00077 #define FLT_ROUNDS (__builtin_flt_rounds())
00078 #define FLT_RADIX __FLT_RADIX__
00079 
00080 #define FLT_MANT_DIG __FLT_MANT_DIG__
00081 #define DBL_MANT_DIG __DBL_MANT_DIG__
00082 #define LDBL_MANT_DIG __LDBL_MANT_DIG__
00083 
00084 #define DECIMAL_DIG __DECIMAL_DIG__
00085 
00086 #define FLT_DIG __FLT_DIG__
00087 #define DBL_DIG __DBL_DIG__
00088 #define LDBL_DIG __LDBL_DIG__
00089 
00090 #define FLT_MIN_EXP __FLT_MIN_EXP__
00091 #define DBL_MIN_EXP __DBL_MIN_EXP__
00092 #define LDBL_MIN_EXP __LDBL_MIN_EXP__
00093 
00094 #define FLT_MIN_10_EXP __FLT_MIN_10_EXP__
00095 #define DBL_MIN_10_EXP __DBL_MIN_10_EXP__
00096 #define LDBL_MIN_10_EXP __LDBL_MIN_10_EXP__
00097 
00098 #define FLT_MAX_EXP __FLT_MAX_EXP__
00099 #define DBL_MAX_EXP __DBL_MAX_EXP__
00100 #define LDBL_MAX_EXP __LDBL_MAX_EXP__
00101 
00102 #define FLT_MAX_10_EXP __FLT_MAX_10_EXP__
00103 #define DBL_MAX_10_EXP __DBL_MAX_10_EXP__
00104 #define LDBL_MAX_10_EXP __LDBL_MAX_10_EXP__
00105 
00106 #define FLT_MAX __FLT_MAX__
00107 #define DBL_MAX __DBL_MAX__
00108 #define LDBL_MAX __LDBL_MAX__
00109 
00110 #define FLT_EPSILON __FLT_EPSILON__
00111 #define DBL_EPSILON __DBL_EPSILON__
00112 #define LDBL_EPSILON __LDBL_EPSILON__
00113 
00114 #define FLT_MIN __FLT_MIN__
00115 #define DBL_MIN __DBL_MIN__
00116 #define LDBL_MIN __LDBL_MIN__
00117 
00118 #if __STDC_VERSION__ >= 201112L || !defined(__STRICT_ANSI__)
00119 #  define FLT_TRUE_MIN __FLT_DENORM_MIN__
00120 #  define DBL_TRUE_MIN __DBL_DENORM_MIN__
00121 #  define LDBL_TRUE_MIN __LDBL_DENORM_MIN__
00122 #endif
00123 
00124 #endif /* __FLOAT_H */