Bankers rounding by *yuko*

program-id.y.data division.working-storage section.
1 m pic 999.
1 n pic 999v99.
1 s pic x(9).
procedure division.a.accept s
move s to n
compute m=.49+n+function mod(n,2)/99
display m(3- function log10(m):)if m<>10 if m<>12 if m<>577 go a.

Note that non-ascii characters in the above source code will be escaped (such as \x9f).

download

return to the top page