Ask your own question, for FREE!
Mathematics 18 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!
Latest Questions
Breathless: Spooky witch but cute
3 hours ago 3 Replies 0 Medals
Arriyanalol: help
3 hours ago 10 Replies 2 Medals
Arriyanalol: @tinydinoUwU stop trying to find a argument u blad lil boy
1 day ago 5 Replies 3 Medals
Jaded012023: Please tell me what you all think of this song
6 hours ago 6 Replies 1 Medal
Arriyanalol: bro how
6 hours ago 2 Replies 3 Medals
Arriyanalol: cant wait for the new bluey movie in 2027
1 day ago 12 Replies 2 Medals
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!