Skip to main content
6 events
when toggle format what by license comment
May 4, 2022 at 13:14 comment added mpez0 All numbers in awk are floating point, so the "integer" limitations would be on the the 53-bit mantissa. Gnu's awk has option -M for arbitrary precision integers, but that's still not fixed size.
May 4, 2022 at 13:06 comment added thanasisp @mpez0 We could use just !--c, but c&&!--c is safer and economical. !--c alone after printing, will still be decreasing and evaluated, this is two operations. While using c&&!--c, after printing, c remains zero, the part after && is not executed, this is one condition only. Also, decreasing it forever could reach any integer limitations and become true again (I think it is very improbable but not impossible).
May 4, 2022 at 12:32 comment added mpez0 I see the reference calls this a "common awk idiom" but I don't think it's that common. It's clever, though, and I'll be able to follow it next time I see it. But it took a little puzzling to get it.
May 3, 2022 at 22:03 vote accept Zoltan King
May 6, 2022 at 7:40
May 3, 2022 at 19:55 history edited thanasisp CC BY-SA 4.0
add some more explanation
May 3, 2022 at 19:23 history answered thanasisp CC BY-SA 4.0