User manual

MPLAB
®
XC8 C Compiler User’s Guide
DS52053B-page 148 2012 Microchip Technology Inc.
Two sets of macros are available for float and double types, where XXX represents
FLT and DBL, respectively. So, for example, FLT_MAX represents the maximum float-
ing-point value of the float type. It can have two values depending on whether float
is a 24 or 32 bit wide format. DBL_MAX represents the same values for the double
type.
As the size and format of floating-point data types are not fully specified by the ANSI
Standard, these macros allow for more portable code which can check the limits of the
range of values held by the type on this implementation.
TABLE 5-6: RANGES OF FLOATING-POINT TYPE VALUES
Symbol Meaning 24-bit Value 32-bit Value
XXX_RADIX Radix of exponent representation 2 2
XXX_ROUNDS Rounding mode for addition 0 0
XXX_MIN_EXP Min. n such that FLT_RADIX
n-1
is
a normalized float value
-125 -125
XXX_MIN_10_EXP Min. n such that 10
n
is a
normalized float value
-37 -37
XXX_MAX_EXP Max. n such that FLT_RADIX
n-1
is a normalized float value
128 128
XXX_MAX_10_EXP Max. n such that 10
n
is a
normalized float value
38 38
XXX_MANT_DIG Number of FLT_RADIX mantissa
digits
16 24
XXX_EPSILON The smallest number which
added to 1.0 does not yield 1.0
3.05176e-05 1.19209e-07