Skip to main content
Library homepage
 

Text Color

Text Size

 

Margin Size

 

Font Type

Enable Dyslexic Font
Mathematics LibreTexts

1.9: Inexact Numbers

( \newcommand{\kernel}{\mathrm{null}\,}\)

Example:

13=(1)0×14×(1+13)

so that p=e127=2 and e=125=1283, or in binary, e=01111101. How is f=1/3 represented in binary? To compute binary number, multiply successively by 2 as follows:

0.3330.0.6660.01.3330.010.6660.0101.3330.0101 etc. 

so that 1/3 exactly in binary is 0.010101 With only 23 bits to represent f, the number is inexact and we have

f=01010101010101010101011

where we have rounded to the nearest binary number (here, rounded up). The machine number 1/3 is then represented as

00111110101010101010101010101011

or in hex

 Зeaaaaab. 

Find smallest positive integer that is not exact in single pre- cision

Let N be the smallest positive integer that is not exact. Now, I claim that

N2=223×1.111

and

N1=224×1.000

The integer N would then require a one-bit in the 224 position, which is not available. Therefore, the smallest positive integer that is not exact is 224+1=16777217. In MATLAB, single (224) has the same value as single (224+1). Since single (224+1) is exactly halfway between the two consecutive machine numbers 224 and 224+2, MATLAB rounds to the number with a final zero-bit in f, which is 224.


This page titled 1.9: Inexact Numbers is shared under a CC BY 3.0 license and was authored, remixed, and/or curated by Jeffrey R. Chasnov via source content that was edited to the style and standards of the LibreTexts platform.

Support Center

How can we help?