In class, we have discussed how the computer represents numbers in double precis
ID: 3878139 • Letter: I
Question
In class, we have discussed how the computer represents numbers in double precision in the memory. The largest number and the smallest positive normalized number that can be presented are given by the predefined variables realmax and realmin respectively. The machine epsilon is given by eps. Another way to represent numbers is to use the single precision. It uses N 23 digits for the fraction part. The exponent falls in the range L--126 e 127 (a) What is the largest and the smallest normalized real numbers that can be exactly represented in the sin- gle precision? Write down the expressions in the binary form. Then transform the binary representatiorn into the decimal form and evaluate it in MATLAB (b) What is the machine epsilon for the single precision? Write down the expression in both binary and decimal form and evaluate it in MATLAB (c) How many digits are meaningful in the single precision? (d) Write down two numbers that are equivalent in the single precision. Hint: You can check your answers to (a) and (b) with the MATLAB predefined variables realmin('single'), realmax('single') and eps ('single')Explanation / Answer
a) smallest:
binary- 0 00000001 00000000 00000000 00000000 00000000
float- 1.17549435 x 10-38
largest:
binary- 0 11111111 00000000 00000000 00000000 00000000
float- 3.40282366 x 1038
b) epsilon:
binary: 0 01101000 00000000 00000000 00000000 00000000
float- 1.1921 x 10-7
c) 6
d) 0 and -0
Related Questions
Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.