Loading, please wait...

Floating-Point Types

Float data type allows a variable to store decimal values. The storage size of float data type is 4. This also varies depending upon the processor in the CPU as “int” data type. We can use up to 6 digits after decimal using float data type. For example, 10.456789 can be stored in a variable using float data type.

 

Type

Storage size(in bytes)

Value range

Precision

float

4

1.2E-38 to 3.4E+38

6 decimal places

double

8

2.3E-308 to 1.7E+308

15 decimal places

long double

10

3.4E-4932 to 1.1E+4932

19 decimal places