Unit 4 - Floating Point data types - float and double
This type can store floating point in computer memory.
Syntax : double name_identifier
Example: double pendapatan_bersih,cukai_pendapatan;
double nilai;
Memory storage that use for variable pendapatan_bersih be able to store floating point data. But int and char data types only can be stored according to computer types. The three floating points data in C++ such as;
1. float
2. double
3. long double
The comparison of the three types are range value and digits.
Float : 1.175494e-38 to 3.402823e+38 (6 place decimal )
Double : 2.225074e308 to 1.797693e+308 (15 place decimal)
Long double : 3.362103e-4932 to 1.189731e+4932 (19 place dec.)
Syntax : double name_identifier
Example: double pendapatan_bersih,cukai_pendapatan;
double nilai;
Memory storage that use for variable pendapatan_bersih be able to store floating point data. But int and char data types only can be stored according to computer types. The three floating points data in C++ such as;
1. float
2. double
3. long double
The comparison of the three types are range value and digits.
Float : 1.175494e-38 to 3.402823e+38 (6 place decimal )
Double : 2.225074e308 to 1.797693e+308 (15 place decimal)
Long double : 3.362103e-4932 to 1.189731e+4932 (19 place dec.)
No comments:
Post a Comment