mws_gen_aae_spe_floatingpoint

# mws_gen_aae_spe_floatingpoint - Chapter 01.05 Floating...

This preview shows pages 1–3. Sign up to view the full content.

01.05.1 Chapter 01.05 Floating Point Representation After reading this chapter, you should be able to: 1. convert a base-10 number to a binary floating point representation, 2. convert a binary floating point number to its equivalent base-10 number, 3. understand the IEEE-754 specifications of a floating point representation in a typical computer, 4. calculate the machine epsilon of a representation. Consider an old time cash register that would ring any purchase between 0 and 999.99 units of money. Note that there are five (not six) working spaces in the cash register (the decimal number is shown just for clarification). Q : How will the smallest number 0 be represented? A : The number 0 will be represented as 000.00 Q : How will the largest number 999.99 be represented? A : The number 999.99 will be represented as 999.99 Q : Now look at any typical number between 0 and 999.99, such as 256.78. How would it be represented? A : The number 256.78 will be represented as 256.78 Q : What is the smallest change between consecutive numbers? A : It is 0.01, like between the numbers 256.78 and 256.79. Q : What amount would one pay for an item, if it costs 256.789? A : The amount one would pay would be rounded off to 256.79 or chopped to 256.78. In either case, the maximum error in the payment would be less than 0.01. Q : What magnitude of relative errors would occur in a transaction? A : Relative error for representing small numbers is going to be high, while for large numbers the relative error is going to be small.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
01.05.2 Chapter 01.05 For example, for 256.786, rounding it off to 256.79 accounts for a round-off error of 004 . 0 79 . 256 786 . 256 . The relative error in this case is 100 786 . 256 004 . 0 t % 001558 . 0 . For another number, 3.546, rounding it off to 3.55 accounts for the same round-off error of 004 . 0 55 . 3 546 . 3 . The relative error in this case is 100 546 . 3 004 . 0 t % 11280 . 0 . Q : If I am interested in keeping relative errors of similar magnitude for the range of numbers, what alternatives do I have? A : To keep the relative error of similar order for all numbers, one may use a floating-point representation of the number. For example, in floating-point representation, a number 256.78 is written as 2 10 5678 . 2 , 003678 . 0 is written as , 10 678 . 3 3 and 789 . 256 is written as 2 10 56789 . 2 . The general representation of a number in base-10 format is given as exponent 10 mantissa sign or for a number y , e m y 10 Where 1 - or 1 number, the of sign 10 1 mantissa, m m exponent integer e (also called ficand) Let us go back to the example where we have five spaces available for a number. Let us also limit ourselves to positive numbers with positive exponents for this example. If we use the same five spaces, then let us use four for the mantissa and the last one for the exponent. So
This is the end of the preview. Sign up to access the rest of the document.

## This note was uploaded on 06/12/2011 for the course EML 3041 taught by Professor Kaw,a during the Spring '08 term at University of South Florida - Tampa.

### Page1 / 8

mws_gen_aae_spe_floatingpoint - Chapter 01.05 Floating...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online