Floating point types :
Integer type can hold only whole numbers, so we use another type known as Floating point datatypes to hold numbers contain fractional points, such as 2.7,5.984.
There are two types of floating point types
1. float
2. double
The float types values are single-precision numbers with a precision of seven digits and the double types represent double precision numbers with precision of 15/16 digits
type |
Size(Byte) |
Min value |
Max value |
Float |
4 |
1.5x10 ^ -45 |
3.4x10^38 |
Double |
8 |
5.6x10 ^-324 |
1.7 x 10^308 |
Floating point datatype supports a special value known as Not-a-Numbers(Nan),Nan is used to represent the result of operation such as dividing zero by zero where an actual number is not produced.