PIPS
|
#include <float.h>
#include <limits.h>
Go to the source code of this file.
Macros | |
#define | FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7) |
Supplemental information about the floating-point formats. More... | |
#define | DBL_EXP_MASK ((DBL_MAX_EXP - DBL_MIN_EXP) | 7) |
#define | LDBL_EXP_MASK ((LDBL_MAX_EXP - LDBL_MIN_EXP) | 7) |
#define | FLT_EXP_BIT |
Number of bits used for the exponent of a floating-point number, including the exponent's sign. More... | |
#define | DBL_EXP_BIT |
#define | LDBL_EXP_BIT |
#define | FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1) |
Number of bits used for a floating-point number: the mantissa (not counting the "hidden bit", since it may or may not be explicit), the exponent, and the sign. More... | |
#define | DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1) |
#define | LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1) |
#define | SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) |
Number of bytes used for a floating-point number. More... | |
#define | SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) |
#define | SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) |
Typedefs | |
typedef int | verify_sizeof_flt[SIZEOF_FLT<=sizeof(float) ? 1 :-1] |
Verify that SIZEOF_FLT <= sizeof (float) etc. More... | |
typedef int | verify_sizeof_dbl[SIZEOF_DBL<=sizeof(double) ? 1 :- 1] |
typedef int | verify_sizeof_ldbl[SIZEOF_LDBL<=sizeof(long double) ? 1 :- 1] |
#define DBL_EXP_BIT |
#define DBL_TOTAL_BIT ((DBL_MANT_BIT - 1) + DBL_EXP_BIT + 1) |
#define FLT_EXP_BIT |
Number of bits used for the exponent of a floating-point number, including the exponent's sign.
#define FLT_EXP_MASK ((FLT_MAX_EXP - FLT_MIN_EXP) | 7) |
Supplemental information about the floating-point formats.
Copyright (C) 2007, 2009-2014 Free Software Foundation, Inc. Written by Bruno Haible bruno, 2007. @cli sp.or g
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 3, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program; if not, see http://www.gnu.org/licenses/.
Number of bits in the mantissa of a floating-point number, including the "hidden bit".
Bit mask that can be used to mask the exponent, as an unsigned number.
#define FLT_TOTAL_BIT ((FLT_MANT_BIT - 1) + FLT_EXP_BIT + 1) |
#define LDBL_EXP_BIT |
#define LDBL_TOTAL_BIT ((LDBL_MANT_BIT - 1) + LDBL_EXP_BIT + 1) |
#define SIZEOF_DBL ((DBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) |
#define SIZEOF_FLT ((FLT_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) |
Number of bytes used for a floating-point number.
This can be smaller than the 'sizeof'. For example, on i386 systems, 'long double' most often have LDBL_MANT_BIT = 64, LDBL_EXP_BIT = 16, hence LDBL_TOTAL_BIT = 80 bits, i.e. 10 bytes of consecutive memory, but sizeof (long double) = 12 or = 16.
#define SIZEOF_LDBL ((LDBL_TOTAL_BIT + CHAR_BIT - 1) / CHAR_BIT) |
typedef int verify_sizeof_dbl[SIZEOF_DBL<=sizeof(double) ? 1 :- 1] |
typedef int verify_sizeof_flt[SIZEOF_FLT<=sizeof(float) ? 1 :-1] |
typedef int verify_sizeof_ldbl[SIZEOF_LDBL<=sizeof(long double) ? 1 :- 1] |