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

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 creating the procedure.)
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

1 Expert Approved Answer
Step: 1 Unlock

a 12403 b 12403 ... View full answer

blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Document Format (1 attachment)

Word file Icon

731-M-N-A-N-L-A (177).docx

120 KBs Word File

Students Have Also Explored These Related Numerical Analysis Questions!