/usr/share/cagefs-skeleton.old/usr/share/awk
# round.awk --- do normal rounding # # Arnold Robbins, arnold@skeeve.com, Public Domain # August, 1996 function round(x, ival, aval, fraction) { ival = int(x) # integer part, int() truncates # see if fractional part if (ival == x) # no fraction return ival # ensure no decimals if (x < 0) { aval = -x # absolute value ival = int(aval) fraction = aval - ival if (fraction >= .5) return int(x) - 1 # -2.5 --> -3 else return int(x) # -2.3 --> -2 } else { fraction = x - ival if (fraction >= .5) return ival + 1 else return ival } }
.
Edit
..
Edit
assert.awk
Edit
bits2str.awk
Edit
cliff_rand.awk
Edit
ctime.awk
Edit
ftrans.awk
Edit
getopt.awk
Edit
gettime.awk
Edit
group.awk
Edit
have_mpfr.awk
Edit
inplace.awk
Edit
intdiv0.awk
Edit
join.awk
Edit
libintl.awk
Edit
noassign.awk
Edit
ns_passwd.awk
Edit
ord.awk
Edit
passwd.awk
Edit
processarray.awk
Edit
quicksort.awk
Edit
readable.awk
Edit
readfile.awk
Edit
rewind.awk
Edit
round.awk
Edit
shellquote.awk
Edit
strtonum.awk
Edit
walkarray.awk
Edit
zerofile.awk
Edit