During a file-system cleanup I noticed a strange behavior of awk (HP-UX 11iv3 / IA64). When summing up the size of files in one directory it gives different numbers when using print as opposed to printf:
find . -type f -name '*.dmp.Z' -mtime +35 -exec ls -l {} \+ | \
awk 'BEGIN{ OFMT="%f" } { total += $5 } END{ printf "%d\n", total; print total }'
1439122395
5734089691.000000
However, if I use floating point conversion for printf, the numbers are equal. Is there any (possibly documented) reason for this behavior? For this example I can adjust easily, but it might break older scripts who's coders never were aware of this.