Ask your own question, for FREE!
Computer Science 12 Online
OpenStudy (anonymous):

This is a question that I really really need the answer too. Please explain it in the simplest and easiest way possible. WHAT IS THE DIFFERENCE BETWEEN SINGLE, DOUBLE, & DECIMAL in Intro to Computer Programming?

OpenStudy (e.mccormick):

The name single is incomplete. The full name is single precision. That comes form a single, 32 bit word being used to store the number. A double precision uses 2, 32 bit words or 64 bits to store the number. Neither of these actually stores a decimal as you know it. They store the closest possible approximation, which may or may not be the actual number.

OpenStudy (anonymous):

could you explain it to me what is the difference between single and double is? Please explain this to me like I am in elementary school. Because that is how much I don't understand the details of computers :P

OpenStudy (anonymous):

thank you for the help @e.mccormick

OpenStudy (e.mccormick):

Memory in a computer is like a light switch. It can be on. It can be off. Nothing else exists. This is a base 2 (for 2 states) number system known as binary. Each binary digit is a called a bit. Now, you can do integers to bits pretty easy. In decimal, 10 means 1 in the tens place and nothing in the ones place, so ten. In binary the places are different. The ones is the same, 0 and 1, but the next place is the twos place, then fours, then eights, and so on. These are powers of 2. So 0010 is no eights, no fours, a twos, and no ones, which adds up to 2 in decimal. 1101, would be an eight, a four, no twos, and a one so 13 in decimal. That is easy. But, when you do decimals, well, things are different. There is no easy way to just represent a decimal with 100% accuracy. That is where the idea of a single or double precision number comes into play. They are ways to approximate the decimals as best as possible. The larger the precision, the more memory it takes to store and the better the accuracy is.

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!