22.08.2013 Views

How to Print Floating-Point Numbers Accurately - Computer Science ...

How to Print Floating-Point Numbers Accurately - Computer Science ...

How to Print Floating-Point Numbers Accurately - Computer Science ...

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Table 8: Procedure Cu<strong>to</strong>fAdjust<br />

procedure Cu<strong>to</strong>ffAdjust;<br />

begin<br />

a t Cu<strong>to</strong>ffPlace - k;<br />

Y + s;<br />

cases<br />

a?O: forjc1<strong>to</strong>adoytyxB;<br />

aOAw~max(d+1,2)<br />

ccw-d-l;<br />

GENERATE! (b,e, f,p, B, “absolute”, -d);<br />

GENERATE ? (U, k);<br />

ifk < c then<br />

ifk 0 then fiU(c - 1, u “); USER! (“on) fi;<br />

USER! (‘V’);<br />

fiZi(min(-k, d), “0”);<br />

else jiZr(c - k - 1, u “) fi;<br />

loop<br />

whilek>-d:<br />

Digit Chart U);<br />

ifk = 0 then USER! (“.“) fi;<br />

GENERATE<br />

repeat;<br />

? (U, k) ;<br />

else fiZZ(w, u*n) A;<br />

USER ! (“0”);<br />

end:

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!