06.09.2021 Views

First Semester in Numerical Analysis with Julia, 2020a

First Semester in Numerical Analysis with Julia, 2020a

First Semester in Numerical Analysis with Julia, 2020a

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

CHAPTER 1. INTRODUCTION 30<br />

where<br />

s → sign of x = ±1<br />

e → exponent, <strong>with</strong> bounds L ≤ e ≤ U<br />

(.a 1 ...a t ) β = a 1<br />

β + a 2<br />

β + ... + a t<br />

; the mantissa<br />

2 βt β → base<br />

t → number of digits; the precision.<br />

In the float<strong>in</strong>g-po<strong>in</strong>t representation (1.1), if we specify e <strong>in</strong> such a way that a 1 ≠0, then<br />

the representation will be unique. This is called the normalized float<strong>in</strong>g-po<strong>in</strong>t representation.<br />

For example if β =10, <strong>in</strong> the normalized float<strong>in</strong>g-po<strong>in</strong>t we would write 0.012 as<br />

0.12 × 10 −1 , <strong>in</strong>stead of choices like 0.012 × 10 0 or 0.0012 × 10.<br />

In most computers today, the base is β = 2. Bases 8 and 16 were used <strong>in</strong> old IBM<br />

ma<strong>in</strong>frames <strong>in</strong> the past. Some handheld calculators use base 10. An <strong>in</strong>terest<strong>in</strong>g historical<br />

example is a short-lived computer named Setun developed at Moscow State University which<br />

used base 3.<br />

There are several choices to make <strong>in</strong> the general float<strong>in</strong>g-po<strong>in</strong>t model (1.1) for the values<br />

of s, β, t, e. The IEEE 64-bit float<strong>in</strong>g-po<strong>in</strong>t representation is the specific model used <strong>in</strong> most<br />

computers today:<br />

x =(−1) s (1.a 2 a 3 ...a 53 ) 2 2 e−1023 . (1.2)<br />

Some comments:<br />

• Notice how s appears <strong>in</strong> different forms <strong>in</strong> equations (1.1) and(1.2). In (1.2), s is<br />

either 0 or 1. If s =0,thenx is positive. If s =1,xis negative.<br />

• S<strong>in</strong>ce β =2, <strong>in</strong> the normalized float<strong>in</strong>g-po<strong>in</strong>t representation of x the first (nonzero)<br />

digit after the decimal po<strong>in</strong>t has to be 1. Then we do not have to store this number.<br />

That’s why we write x as a decimal number start<strong>in</strong>g at 1 <strong>in</strong> (1.2). Even though precision<br />

is t =52, we are able to access up to the 53rd digit a 53 .<br />

• The bounds for the exponent are: 0 ≤ e ≤ 2047. We will discuss where 2047 comes<br />

from shortly. But first, let’s discuss why we have e − 1023 as the exponent <strong>in</strong> the<br />

representation (1.2), as opposed to simply e (which we had <strong>in</strong> the representation (1.1)).<br />

If the smallest exponent possible was e =0, then the smallest positive number the<br />

computer can generate would be (1.00...0) 2 =1: certa<strong>in</strong>ly we need the computer to

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!