c language float type number of digits after the decimal point

  • 2020-06-23 01:39:17
  • OfStack

How many significant digits are there after the decimal point?

The float type has 6 to 7 significant digits after the decimal point.

In C language, floating point 1 is generally divided into float single precision, double double precision, long double long precision, single precision floating point after the decimal point is 6-7 digits and double precision floating point after the decimal point is 15-16 digits. Single precision is 32 bits, double precision is 64 bits, 8 bits are 1 byte.

In the C language standard library header file float. h defines the valid number of floating point Numbers after the decimal point:


//float.h Section of the header file 

#define DBL_DIG 15 // Double precision after the decimal point 15 position 

#define FLT_DIG 6 // Single precision after the decimal point 6 position 

#define LDBL_DIG 19 // Long double decimal point 19

Above is c language float after the decimal point several significant Numbers related content, thank you for your learning and support for this site.


Related articles: