|
| 1 | +/* This file is part of the Compcert verified compiler. |
| 2 | + * |
| 3 | + * Copyright (c) 2015 Institut National de Recherche en Informatique et |
| 4 | + * en Automatique. |
| 5 | + * |
| 6 | + * Redistribution and use in source and binary forms, with or without |
| 7 | + * modification, are permitted provided that the following conditions are met: |
| 8 | + * * Redistributions of source code must retain the above copyright |
| 9 | + * notice, this list of conditions and the following disclaimer. |
| 10 | + * * Redistributions in binary form must reproduce the above copyright |
| 11 | + * notice, this list of conditions and the following disclaimer in the |
| 12 | + * documentation and/or other materials provided with the distribution. |
| 13 | + * * Neither the name of the <organization> nor the |
| 14 | + * names of its contributors may be used to endorse or promote products |
| 15 | + * derived from this software without specific prior written permission. |
| 16 | + * |
| 17 | + * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| 18 | + * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| 19 | + * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR |
| 20 | + * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL <COPYRIGHT |
| 21 | + * HOLDER> BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, |
| 22 | + * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, |
| 23 | + * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR |
| 24 | + * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF |
| 25 | + * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING |
| 26 | + * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS |
| 27 | + * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
| 28 | + */ |
| 29 | + |
| 30 | +/* <float.h> -- characteristics of floating types (ISO C99 7.7) */ |
| 31 | + |
| 32 | +#ifndef _FLOAT_H |
| 33 | +#define _FLOAT_H |
| 34 | + |
| 35 | +/* FP numbers are in binary */ |
| 36 | +#define FLT_RADIX 2 |
| 37 | + |
| 38 | +/* No excess precision is used during FP arithmetic */ |
| 39 | +#define FLT_EVAL_METHOD 0 |
| 40 | + |
| 41 | +/* FP operations round to nearest even */ |
| 42 | +#define FLT_ROUNDS 1 |
| 43 | + |
| 44 | +/* Number of decimal digits sufficient to represent FP numbers */ |
| 45 | +#define DECIMAL_DIG 17 |
| 46 | + |
| 47 | +/* The "float" type is IEEE binary32 */ |
| 48 | +#define FLT_MANT_DIG 24 |
| 49 | +#define FLT_DIG 6 |
| 50 | +#define FLT_ROUNDS 1 |
| 51 | +#define FLT_EPSILON 0x1p-23F |
| 52 | +#define FLT_MIN_EXP (-125) |
| 53 | +#define FLT_MIN 0x1p-126F |
| 54 | +#define FLT_MIN_10_EXP (-37) |
| 55 | +#define FLT_MAX_EXP 128 |
| 56 | +#define FLT_MAX 0x1.fffffep+127F |
| 57 | +#define FLT_MAX_10_EXP 38 |
| 58 | + |
| 59 | +/* The "double" type is IEEE binary64 */ |
| 60 | +#define DBL_MANT_DIG 53 |
| 61 | +#define DBL_DIG 15 |
| 62 | +#define DBL_EPSILON 0x1p-52 |
| 63 | +#define DBL_MIN_EXP (-1021) |
| 64 | +#define DBL_MIN 0x1p-1022 |
| 65 | +#define DBL_MIN_10_EXP (-307) |
| 66 | +#define DBL_MAX_EXP 1024 |
| 67 | +#define DBL_MAX 0x1.fffffffffffffp+1023 |
| 68 | +#define DBL_MAX_10_EXP 308 |
| 69 | + |
| 70 | +/* The "long double" type, when supported, is IEEE binary64 */ |
| 71 | +#define LDBL_MANT_DIG 53 |
| 72 | +#define LDBL_DIG 15 |
| 73 | +#define LDBL_EPSILON 0x1p-52L |
| 74 | +#define LDBL_MIN_EXP (-1021) |
| 75 | +#define LDBL_MIN 0x1p-1022L |
| 76 | +#define LDBL_MIN_10_EXP (-307) |
| 77 | +#define LDBL_MAX_EXP 1024 |
| 78 | +#define LDBL_MAX 0x1.fffffffffffffp+1023L |
| 79 | +#define LDBL_MAX_10_EXP 308 |
| 80 | + |
| 81 | +#endif |
| 82 | + |
0 commit comments