This preview shows page 1. Sign up to view the full content.
Unformatted text preview: . (exactly ) and this is truncated to 12.49999
(same w ith rounding)
(If y ou w ant to simulate binary machines do this:
a. D o the operation EX A CT LY (in binary).
b. T ake this result, KEEP the binary point, but truncate (or round) all bits follow ing
the leading 24.)
F or double precision simulation use 16 decimal digits or 52 binary bits.
3 . So, other than keeping track of w here the decimal point belongs, the decimal point (or
binary point) has no effect on the calculation?
T his simple simulation is actually exactly correct EX CEPT for w hat happens if overflow or
underflow occurs: the number is above the overflow level or beneath the underflow level. In
those cases w hat happens (stop, set result to zero, use an "Inf", ...) depends upon the
computing e nvironment. T his happens so rarely (look at those underflow and overflow values
up above) that w e w ill ignore it here.
4 . What does "precision" mean?
Suppose an exact calculation results in v and the floating point calculations results in v . T he
e rror is v v , the absolute...
View Full Document
- Spring '08