# What is float, double, long double ?

`#include<stdio.h>#include<float.h>int main( void){  /*    print absolute value min,max range , each floating    type .*/  printf( "float absolute value of range : %e\n", FLT_MAX);  printf( "double absolute value of range : %e\n", DBL_MAX);  printf( "long double absolute value of range : %Le\n", LDBL_MAX);/* print closest absolute value to 0 , for each     of the floating types .*/  printf( "closest to 0 absolute value , float : %e\n", FLT_MIN);  printf( "closest to 0 absolute value , double : %e\n", DBL_MIN);  printf( "closest to 0 absolute value , long double : %Le\n", LDBL_MIN);}/* Output :float absolute value of range : 3.402823e+38double absolute value of range : 1.797693e+308long double absolute value of range : 1.189731e+4932closest to 0 absolute value , float : 1.175494e-38closest to 0 absolute value , double : 2.225074e-308closest to 0 absolute value , long double : 3.362103e-4932 */`
`#include<stdio.h>#include<float.h>int main( void){  printf( "FLT_EVAL_METHOD : %d\n" , FLT_EVAL_METHOD);}/* Output : FLT_EVAL_METHOD : 0 */`

# Floating point literal

`d+.d*d*.d+d+[.]ed+`
`double x; x = 1. ;x = .1 ;x = 1.0;x = 1e1; // 10.0x = 1.E1; // 10.0`
`float aFloat = 1.0f ;double aDouble = 1.0 ;long double alongDouble = 1.0L ;`
`0xh+[.]h*Pd+0xh*.h+Pd+`
`double x ;x = 0xfP0; // 15.0x = 0Xf.P0; // 15.0x = 0xf.0P0; // 15.0x = 0X.1P0; // 1/16 = 0.062500x = 0x.1p1; // (1/16) * 2 = 0.125000`
`float aFloat = 0x1P2f;// 4.0fdouble aDouble = 0x.1p3 ;// 0.5long double alongDouble = 0X.3p2L ; // 0.75L`

--

--

## More from Analytics Vidhya

Analytics Vidhya is a community of Analytics and Data Science professionals. We are building the next-gen data science ecosystem https://www.analyticsvidhya.com