Skip to main content
6 events
when toggle format what by license comment
Dec 20, 2019 at 16:20 comment added jesse_b If it's being run against an empty file it should error IMO because something has been done wrong.
Dec 20, 2019 at 16:19 comment added Paul_Pedant I wouldn't. But users are a whole new thing. I like your initialising from NR==1. I use BEGIN and some arbitrary max and min, and it always looks clumsy.
Dec 20, 2019 at 16:16 comment added jesse_b @Paul_Pedant: Don't use it on an empty file.
Dec 20, 2019 at 16:15 comment added Paul_Pedant Empty file gets a fatal divide-by-zero. print (NR ? sum / NR : "NaN")
Dec 20, 2019 at 15:45 history edited jesse_b CC BY-SA 4.0
deleted 48 characters in body
Dec 20, 2019 at 15:39 history answered jesse_b CC BY-SA 4.0