Previous Table of Contents Next


3.10.14. <limits.h>

The header <limits.h> defines several macros that indicate the ranges of various types under a particular implementation. The macros are as follow:

SCHAR_MIN SCHAR_MAX UCHAR_MAX
CHAR_MIN CHAR_MAX
SHRT_MIN SHRT_MAX USHRT_MAX
INT_MIN INT_MAX UINT_MAX
LONG_MIN LONG_MAX ULONG_MAX
CHAR_BIT MB_LEN_MAX

The various MIN and MAX macros define the minimum and maximum values of the character and integer types, both signed and unsigned. CHAR_BIT is the number of bits in a char. MB_LEN_MAX is the maximum number of bytes in a single multibyte character sequence.

3.10.15. <float.h>

The header <float.h> defines several macros that describe the machine’s floating-point representation(s). The macros are as follow:

FLT_RADIX FLT_ROUNDS
FLT_MANT_DIG DBL_MANT_DIG LDBL_MANT_DIG
FLT_DIG DBL_DIG LDBL_DIG
FLT_MIN_EXP DBL_MIN_EXP LDBL_MIN_EXP
FLT_MIN_10_EXP DBL_MIN_10_EXP LDBL_MIN_10_EXP
FLT_MAX_EXP DBL_MAX_EXP LDBL_MAX_EXP
FLT_MAX_10_EXP DBL_MAX_10_EXP LDBL_MAX_10_EXP
FLT_MAX DBL_MAX LDBL_MAX
FLT_EPSILON DBL_EPSILON LDBL_EPSILON
FLT_MIN DBL_MIN LDBL_MIN

FLT_RADIX is the underlying radix of the floating-point model. FLT_ROUNDS is a constant indicating the rounding model for floating-point addition: 0 if toward 0, 1 if to nearest, 2 if toward +∞, 3 if toward –∞, and -1 if indeterminate. The remaining macros give the properties of the types float, double, and long double. The MANT_DIG macros give the number of digits (base FLT_RADIX) in the mantissa. The DIG macros give the approximate number of equivalent base-10 digits of precision. The MIN_EXP and MAX_EXP macros give the minimum and maximum exponents, respectively, and the MIN_10_EXP and MAX_10_EXP give their approximate base-10 equivalents. The MIN and MAX macros give the minimum and maximum representable values, and the EPSILON values give the difference between 1.0 and the next larger representable number.

3.10.16. <iso646.h>

The header <iso646.h> simply defines a few macros that make it easier to write C programs on machines with restricted character sets. (It is a new header, introduced in NA1; it may not be present in all compilers.) The macro definitions are as follow:

#define and &&
#define and_eq &=
#define bitand &
#define bitor |
#define compl ~
#define not !
#define not_eq !=
#define or ||
#define or_eq |=
#define xor ^
#define xor_eq ^=

3.10.17. <wchar.h>

This header provides companion functions for nearly all of the character- and string-related functions in the rest of the standard library, tailored for use with wide characters, that is, values of type wchar_t. <wchar.h> is a new header, introduced in NA1; it and its functions may not be present in all compilers.

Besides the wchar_t type itself and several other types and macros, this header defines a new type, wint_t, which is an integral type capable of holding all values of type wchar_t and the wide character end-of-file value, WEOF (also defined here). In other words, wint_t plays the same role (with respect to wchar_t) in functions such as wgetchar and iswalpha as int does (with respect to char) in getchar and isalpha.

Besides enlarging the set of functions available for working with wide characters, wide character strings, and multibyte character sequences, this header introduces functions for performing input and output on wide characters, with the assumption that the file or stream being read or written is composed of multibyte character sequences. In other words, as wide characters are read from or written to streams, implicit conversions from and to multibyte character sequences may be performed. Such I/O may entail partial conversions of multibyte character sequences, implying that some state pertaining to the in-progress conversion must be saved. To save this state, a type mbstate_t is defined; an mbstate_t object is potentially associated with each I/O stream, and new conversion functions are provided (see section 3.10.17.7) to accept explicit mbstate_t parameters and allow more flexibility when performing interrupted conversions. (Objects of type mbstate_t are opaque, except that it is possible to learn whether they are in their “initial state.” It is also possible to reset an mbstate_t object to its initial state by assigning to it the value of a statically allocated, default-initialized, and thus 0-valued mbstate_t object.)

See sections 3.10.4.7 and 3.10.18 for information on other wide and multibyte character functions.


Previous Table of Contents Next