Next: , Previous: Debugger, Up: Top


15 Arithmetic and Arbitrary Precision Arithmetic with gawk

There's a credibility gap: We don't know how much of the computer's answers to believe. Novice computer users solve this problem by implicitly trusting in the computer as an infallible authority; they tend to believe that all digits of a printed answer are significant. Disillusioned computer users have just the opposite approach; they are constantly afraid that their answers are almost meaningless.
Donald Knuth1

This chapter discusses issues that you may encounter when performing arithmetic. It begins by discussing some of the general attributes of computer arithmetic, along with how this can influence what you see when running awk programs. This discussion applies to all versions of awk.

The chapter then moves on to describe arbitrary precision arithmetic, a feature which is specific to gawk.


Footnotes

[1] Donald E. Knuth. The Art of Computer Programming. Volume 2, Seminumerical Algorithms, third edition, 1998, ISBN 0-201-89683-4, p. 229.