All versions of C provide two different floating-point data types: float and double. On machines that support IEEE floating point, these data types correspond to single-and double-precision floating point. In addition, the machines use the round-to-even rounding mode. Unfortunately, since the C standards do not require the machine to use IEEE floating point, there are no standard methods to change the rounding mode or to get special values such as -0, +00,-00, or NaN. express
Most systems provide a combination of include ('.h') files and procedure libraries to provide access to these features, but the details vary from one system to another. For example, the GNU compiler GCC defines program constants INFINITY and NAN when the following sequence occurs in the program file: app
#define _GNU_SOURCE 1 ide
#define <math.h> ui
More recent versions of C, including ISO C99, include a third floating-point data type, long double. For many machines and compilers, this data type is equivalent to the double data type. For Intel-compatible machines, however, GCC implements this data type using an 80-bit "extended precision" format, providing a much larger range and precision than does the standard 64-bit format. this
When casting values between int, float, and double formats, the program changes the numeric values and the bit representations as follows (assuming a 32-bit int): spa