Both long and double have size 8byte which means
the max size is either 2^64 if unsigned or 2^63 - 1 if signed
But my question is why does when I look up the max size of a double it
say's
+/- 4.9406x10-324 to 1.7977x10308
not this
-9223372036854775808 to 9223372036854775807(signed) or 0-18446744073709551616(unsigned)
How can one contain a greater value range ? They both use the same sizes so it would be impossible to get a greater value range in the same size data type I would think? Unless they are using some secret extra datatype behind the scenes that I am not aware off for double values.
Same question applies when I look at integer (4bytes , 32bits ) and floats ( 4bytes , 32 bits )
curious if anybody knows how the floats and doubles are implemented to acheive this?
the max size is either 2^64 if unsigned or 2^63 - 1 if signed
But my question is why does when I look up the max size of a double it
say's
+/- 4.9406x10-324 to 1.7977x10308
not this
-9223372036854775808 to 9223372036854775807(signed) or 0-18446744073709551616(unsigned)
How can one contain a greater value range ? They both use the same sizes so it would be impossible to get a greater value range in the same size data type I would think? Unless they are using some secret extra datatype behind the scenes that I am not aware off for double values.
Same question applies when I look at integer (4bytes , 32bits ) and floats ( 4bytes , 32 bits )
curious if anybody knows how the floats and doubles are implemented to acheive this?