On Tuesday, January 18, 2022 at 9:47:23 AM UTC-5, Kenny McCormack wrote:
The GAWK distro contains an example program called arraymax.awk - that calculates the maximum of a series of input values.
Actually, it's just an inaptly-named sample program to demonstrate some array features,
not a general-purpose max calculator. From the docs:
https://www.gnu.org/software/gawk/manual/html_node/Array-Example.html
The following program takes a list of lines, each beginning with a line
number, and prints them out in order of line number. The line numbers
are not in order when they are first read---instead, they
are scrambled. This program sorts the lines by making an array using
the line numbers as subscripts. The program then prints out the lines
in sorted order of their numbers. It is a very simple program and gets confused upon encountering repeated numbers, gaps, or lines that don't
begin with a number:
...
So I don't see why it's a bug. It does what it says it does, but I agree that it certainly
does not calculate maximum values in the general case.
Regards,
Andy
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)