Ask your own question, for FREE!
Mathematics 22 Online
OpenStudy (bahrom7893):

Another quick C++ question

OpenStudy (bahrom7893):

So double can be both integers and decimals right: like 5 would be 5.0 what if i had a decimal 6.3333333333333 How many threes would it keep?

OpenStudy (anonymous):

I know a bit of java, so maybe I can help you if you're lucky.

OpenStudy (bahrom7893):

no this is just basic stuff.. Like that's my question technically how many decimals would "double" data type keep?

OpenStudy (anonymous):

check out this page.. hope it helps http://www.cplusplus.com/doc/tutorial/variables/

OpenStudy (anonymous):

It would be a few, but not infinitely many. With floating point numbers you will often not get 'exactly' what you try to store there.

OpenStudy (anonymous):

You will have a little bit of error. Which is why these sorts of things are not good for money.

OpenStudy (bahrom7893):

oh okay. But for basic stuff this is good enough right? Say I just wanted to write a basic program for calculating area.

OpenStudy (anonymous):

http://www.learncpp.com/ this is another great site to learn the language

OpenStudy (bahrom7893):

tnx a lot guys! =)

OpenStudy (anonymous):

It'll be fine for that.

OpenStudy (anonymous):

Yep, fine for area.

OpenStudy (anonymous):

The double can have ~6 digits. In other words if you write: double a = 6.333333333333333 it will show you: 6.33333 double a = 33.333333333 it will show you: 33.3333

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!