Question: The following Maple procedure chops a floating-point number x to t digits. (Use the Shift and Enter keys at the end of each line when
chop := proc(x, t);
local e, x2;
if x = 0 then 0
else
e := ceil (evalf (log10(abs(x))));
x2 := evalf (trunc (x · 10(t−e)) · 10(e−t));
end if
end;
Verify the procedure works for the following values.
a. x = 124.031, t = 5
b. x = 124.036, t = 5
c. x = −124.031, t = 5
d. x = −124.036, t = 5
e. x = 0.00653, t = 2
f. x = 0.00656, t = 2
g. x = −0.00653, t = 2
h. x = −0.00656, t = 2
Step by Step Solution
3.35 Rating (161 Votes )
There are 3 Steps involved in it
a 12403 b 12403 ... View full answer
Get step-by-step solutions from verified subject matter experts
Document Format (1 attachment)
731-M-N-A-N-L-A (177).docx
120 KBs Word File
