I'm trying to understand the range of data types. For non-floating point numbers it's easy enough, but then for float and double the ranges are listed as:
float: 3.4E +/- 38 (7 digits)
double: 1.7E +/- 308 (15 digits)
But in layman, what exactly does that mean, and how can I make use of that information?
The
3.4E +/- 38
means that:
float
can represent is about 3.4e38;Similarly, the range of negative values is from -3.4e38 to about -3.4e-38.
Here, MeE
denotes M
multiplied by 10 to the E
'th power.
The
(7 digits)
means that a float
can represent approximately seven significant decimal digits.
The reason of these values are approximate is that they are exact in binary, and there's a fractional number of decimal digits for each binary digits.
float: Range is from 3.4E-38
to 3.4E38
(positive or negative), with 7 significant digits of precision.
double: Range is from 1.7E-308
to 1.7E308
(positive or negative), with 15 significant digits of precision.
They also include 0.
mEe
is computer notation for m
times 10 to the e
power.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With