The following Maple procedure chops a floating-point number x to t digits. (Use the Shift and Enter

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 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
Fantastic news! We've Found the answer you've been seeking!

Step by Step Answer:

Related Book For  book-img-for-question

Numerical Analysis

ISBN: 978-0538733519

9th edition

Authors: Richard L. Burden, J. Douglas Faires

Question Posted: