ee231_ass3_sol - EE 231_B1 Numerical Analysis for...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
EE 231_B1 Numerical Analysis for Electrical and Computer Engineers Course Instructor: Dr. Sergiy Vorobyov - 1 - Solutions to Assignment 3 4.3 function ep = macheps % determines the machine epsilon e = 1; while (1) if e+1<=1, break, end e = e/2; end ep = 2*e; >> macheps ans = 2.2204e-016 >> eps ans = 2.2204e-016 4.5 Because the exponent ranges from –126 to 127, the smallest positive number can be represented in binary as where the 23 bits in the mantissa are all 0. This value can be translated into a base-10 value of 2 –126 = 1.1755×10 –38 . The largest positive number can be represented in binary as where the 23 bits in the mantissa are all 1. Since the significand is approximately 2 (it is actually 2 – 2 –23 ), the largest value is therefore 2 +128 = 3.4028×10 38 . The machine epsilon in single precision would be 2 –23 = 1.921×10 –7 . These results can be verified using built-in MATLAB functions, >> realmax('single') ans = 3.4028e+038 >> realmin('single') ans = 1.1755e-038 >> eps('single') ans = 1.1921e-007
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

Page1 / 3

ee231_ass3_sol - EE 231_B1 Numerical Analysis for...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online