Floating point numbers

Recneps

Senior member
Jul 2, 2000
232
0
0
how are floating point numbers stored in a PC and why is it impossible to store .1 as .1 and not some slightly different number. Also what would be stored if .1 can be?
 

Gaunt

Senior member
Aug 29, 2001
450
0
0
I just did a quick search, and this page seems to contain the information you want (link). As for why you can't store .1 as .1, it is a side affect of using the method described. Because only 22 bits are used to store the number, there can only be a certain degree of accuracy. However I don't know if .1 will cause a problem, I'm pretty sure .2 does.

Hopefully that gives you a little more insight. It's been a while since I've looked at this information so I'm not really in the position to explain it better.
 

RossGr

Diamond Member
Jan 11, 2000
3,383
1
0
.1 ( base 10 )= .0001100110011001100....( base 2). Since this infinitly repeating patteren must be truncated to the word length of the floating point number system being used it is impossible to accurately store .1 as a binary number.
 

cmaMath13

Platinum Member
Feb 16, 2000
2,154
0
60
The computer does not care what kind of number you give it, it simple does what it is instructed to do. Decimal numbers (floats) are first converted to scientific notation and normalized. The problem with decimals is accuracy. .1 base 10 is clearly a rational number as well as in binary (base 2). BUT, since it is NON-terminating that is where the problem lines! Let's say we truncate (cut off) at 4 digits, so we get .0001. This equals 0.0625! Not 0.1. If we go out 5 places, we get 0.00011 in base2 which equals 0.09375 (much better)!


Finally, at places we get 0.000110001 in base2 we get 0.095703125 (better still, but not quite).

You can keep on going, but you will never get exactly .1!
 
sale-70-410-exam    | Exam-200-125-pdf    | we-sale-70-410-exam    | hot-sale-70-410-exam    | Latest-exam-700-603-Dumps    | Dumps-98-363-exams-date    | Certs-200-125-date    | Dumps-300-075-exams-date    | hot-sale-book-C8010-726-book    | Hot-Sale-200-310-Exam    | Exam-Description-200-310-dumps?    | hot-sale-book-200-125-book    | Latest-Updated-300-209-Exam    | Dumps-210-260-exams-date    | Download-200-125-Exam-PDF    | Exam-Description-300-101-dumps    | Certs-300-101-date    | Hot-Sale-300-075-Exam    | Latest-exam-200-125-Dumps    | Exam-Description-200-125-dumps    | Latest-Updated-300-075-Exam    | hot-sale-book-210-260-book    | Dumps-200-901-exams-date    | Certs-200-901-date    | Latest-exam-1Z0-062-Dumps    | Hot-Sale-1Z0-062-Exam    | Certs-CSSLP-date    | 100%-Pass-70-383-Exams    | Latest-JN0-360-real-exam-questions    | 100%-Pass-4A0-100-Real-Exam-Questions    | Dumps-300-135-exams-date    | Passed-200-105-Tech-Exams    | Latest-Updated-200-310-Exam    | Download-300-070-Exam-PDF    | Hot-Sale-JN0-360-Exam    | 100%-Pass-JN0-360-Exams    | 100%-Pass-JN0-360-Real-Exam-Questions    | Dumps-JN0-360-exams-date    | Exam-Description-1Z0-876-dumps    | Latest-exam-1Z0-876-Dumps    | Dumps-HPE0-Y53-exams-date    | 2017-Latest-HPE0-Y53-Exam    | 100%-Pass-HPE0-Y53-Real-Exam-Questions    | Pass-4A0-100-Exam    | Latest-4A0-100-Questions    | Dumps-98-365-exams-date    | 2017-Latest-98-365-Exam    | 100%-Pass-VCS-254-Exams    | 2017-Latest-VCS-273-Exam    | Dumps-200-355-exams-date    | 2017-Latest-300-320-Exam    | Pass-300-101-Exam    | 100%-Pass-300-115-Exams    |
http://www.portvapes.co.uk/    | http://www.portvapes.co.uk/    |