Sujet : Re: Loops (was Re: do { quit; } else { })
De : janis_papanagnou+ng (at) *nospam* hotmail.com (Janis Papanagnou)
Groupes : comp.lang.cDate : 20. Apr 2025, 11:41:07
Autres entêtes
Organisation : A noiseless patient Spider
Message-ID : <vu2j05$3kojq$1@dont-email.me>
References : 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31
User-Agent : Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0
On 19.04.2025 21:15, bart wrote:
[...]
I tried this on two online Awks:
I suggest to learn it from scratch - that doesn't require much time
since it's a very terse and to some degree abstract language - and
not trying behavioral analysis in the first place to understand it.
BEGIN {
split ("one two three four five", table)
for (i=9223372036854775800; i<=9223372036854775806; i++)
print i
}
Both went funny, and the limit isn't even on i63.max.
Awk has two primitive data types, numbers and strings. Variables can
be both and get coerced as necessary. The underlying numerical type
is able to carry floating point values.
(If, for example, you iterate ad infinitum you will notice that the
loop value will not change any more at some point.)
Janis
[...]