awk/testdir/t.arith

7 lines
229 B
Plaintext
Raw Normal View History

2019-06-23 05:13:57 -04:00
{ print NR, $1, $1+$1, $1-$1, $1 * $1 }
{ print NR, $1/NR, $1 % NR }
# { print NR, $1++, $1--, --$1, $1-- } # this depends on order of eval of args!
{ print NR, -$1 }
$1 > 0 { print NR, $1 ^ 0.5 }
$1 > 0 { print NR, $1 ** 0.5 }