










Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!











Floating Point Format for Binary Numbers ( ) m [( ) m ( ) ] y m
mantissa 1 10 sign of number 0 for ve, 1 for -ve 2 = < < = + = × × σ σ
e = integer exponent
Example ( ) ( ) ( ) ( ) ( ) 2 2 5 10 2 2
9 bit-hypothetical word the first bit is used for the sign of the number, the second bit for the sign of the exponent, the next four bits for the mantissa, and the next three bits for the exponent We have the representation as 0 0 1 0 1 1 1 0 1 Sign of the number mantissa Sign of the exponent exponent
Example
4
Relative Error and Machine Epsilon
( 0110 ) 2 2 5 10 2
− −
10 bit word (sign, sign of exponent, 4 for exponent, 4 for mantissa) 0 1 0 1 1 0 1 1 0 0 ( ) ( )
IEEE-754 Floating Point Standard
One Great Reference What every computer scientist (and even if you are not) should know about floating point arithmetic! http://www.validlab.com/goldberg/paper.pdf
13 Example# ( ) ( )
Value 1 1. 2
= − × ×
m ( ) ( )
2 1 1. 10100000 2
= − × × ( ) ( )
1 1. 625 2
= − × × ( ) ( )
= − 1 × 1. 625 × 2 = − 5. 5834 × 10
Docsity.com
14 Example# ????????????????????????????????
Represent -5.5834x
as a single precision floating point number. ( ) ( ) 10 1?
Exponent for Special Cases e ′ e
1 ≤ e ′ ≤ 254 e ′ = 0 and^ e ′ = 255 are reserved for special numbers
− 126 ≤ e ≤ 127
Special Exponents and Numbers ∞ e ′ = 0 all zeros e ′ = 255 all ones s m Represents 0 all zeros all zeros 0 1 all zeros all zeros - 0 all ones all zeros 1 all ones all zeros 0 or 1 all ones non-zero NaN e ′