Question: function b = determine_b % determine_b = Determine the base of the floating point number system on % this computer format long % first phase

function b = determine_b
% determine_b = Determine the base of the floating point number system on % this computer format long
% first phase a = 1; while ((a+1) -a) == 1, a = a*2 end
a+1 a (a+1)-a
% second phase i = 1; while (a == (a+i)), i = i + 1 end
% result a+i a b = (a + i) - a;
Download the Matlab function determine b.m from the course homepage. Verify in system (with rounding) on the computer you use. What is the correct base? Then explain how the algorithm works by answering the following questions. correctly determines the base of the floating point number Consider the steps the algorithm would take to determine the base of floating point number system Fb 10,m 2,e-3Assume that your 'decimal' computer uses rounding. (1) Give the successive values that the exact a and the rounded = f1(a) would take on in the first phase of the algorithm. What is the event that triggers the end condition for the first phase? 2) Write down the values that i and ai and fl(a + i) would take on in the second phase. (Note: assume a rounding rule that would round 135 (which lies exactly in the middle between 130 and 140) to 140.) What is the event that triggers the end condition for the second phase? (3) Write down the final value of fl+i), a and b. Download the Matlab function determine b.m from the course homepage. Verify in system (with rounding) on the computer you use. What is the correct base? Then explain how the algorithm works by answering the following questions. correctly determines the base of the floating point number Consider the steps the algorithm would take to determine the base of floating point number system Fb 10,m 2,e-3Assume that your 'decimal' computer uses rounding. (1) Give the successive values that the exact a and the rounded = f1(a) would take on in the first phase of the algorithm. What is the event that triggers the end condition for the first phase? 2) Write down the values that i and ai and fl(a + i) would take on in the second phase. (Note: assume a rounding rule that would round 135 (which lies exactly in the middle between 130 and 140) to 140.) What is the event that triggers the end condition for the second phase? (3) Write down the final value of fl+i), a and b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
