
Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!

function [res] = CHIP(rnd,r,x) % This program is used by Iterative Refinement (Algorithm 7.4) % to round or chop to a specific number of digits. if x == 0 w = 0; else ee = fix(log10(abs(x))); if abs(x) > 1 ee = ee + 1; end; if rnd == 1 w = round(x10^(r-ee))10^(ee-r); else w = fix(x10^(r-ee))10^(ee-r); end; end; res = w ;