# Basic question involving data types

• 10-30-2006
FingerPrint
Basic question involving data types
I skipped around a lot in learning C++ and in doing so, I didnt comprehend things as good as I should have. I decided to start over, well almost over. I was looking at cplusplus.com and in like the third section it talks about data types. I am having trouble understanding what something means. In the chart on the page it shows( the | just represent boxes):

Code:

`| double | Double precision floating point number. | 8bytes | 1.7e +/- 308 (15 digits) |`
What exactly does "1.7e +/- 308 (15 digits)" mean? More specificaly what does 1.7e mean? It also says 15 digits, does that just mean it can go 15 digits from 0 in either direction? Float and ong double are also like this.

I get the rest of the chart, but that part confuses me.

EDIT: I read ona little farther while waiting for an answer. I came across this:

Code:

```They express numbers with decimals and/or exponents. They can include either a decimal point, an e character (that expresses "by ten at the Xth height", where X is an integer value that follows the e character), or both a decimal point and an e character:```
After reading it, I think I know what e means now. Double( 1.7e +/- 308 ) would basically be 1.7 * 10 +/- 308. So its like...oh whats that called lol. Im thinkin exponents/ something else...hmmm...scientific notation. I honestly dont remember much about scientific notation, but thats what its making me think of. So, 1.7e +/- 308 is like the short way of writing out what 1.7 * 10 +/- 308? Stop me if im wrong lol.
• 10-30-2006
Xeridanus
1.7e +/- 308 has to do with the range a double can hold. from 1.7 * 10^308 to 1.7 * 10^-308, and of course the negatives of those numbers as well. a float/double cannot hold exactly 0 because of the way the data is stored in the computer. it is stored as sign-bit|exponent|base (in that order, next to each other). i forget the computer terms for exponent and base but one of them is mantissa. because a double cannot hold exactly 0, there is a gap either side of 0. sign-bit is 1 if the number is negative (0 otherwise, this is the same for ints), exponent is negative(the first bit of the exponent will be 1) if the number is smaller than 1 and base must always have 1 as the first bit.

if this does not answer your question try looking up discrete mathematics for computing.

EDIT: well looky here at what i found :P
http://www.cprogramming.com/tutorial...sentation.html
it might be a bit advanced. i didn't go looking for it, in fact i was looking for something else.