Floating Point Data
The numeric values that have decimal point in them are called floating point data. The floating point data is also called real type data. For example, 0.1, 0.002, 3.1013, 4.0, -3.5, -7.8 are real type values.
Data Types for Floating Point Values
The data types used in C for storing floating point values are as follows:
(i) float (ii) double (iii) long double
i) The float Data Type
The 'float' data type is used to store real values. This data type takes 4 bytes in memory. The 'float' data type has a precision of 6. If the precision is greater than 6 then only the first 6 digits of the precision will be stored.
ii) The double Data Type
The 'double' data type is used to store large real values. It takes 8 bytes in memory. The 'double' data type has a precision of 15 digits.
iii) The long double Data Type
The 'long double' data type is used to store very large real values. It takes 10 bytes in memory. The 'long double' data type has a precision of 19 digits.
No comments:
Post a Comment
Thanks For Visiting Here...!! I will Reply you as soon as possible.