awk/testdir/t.arith

7 lines
229 B
Plaintext

{ 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 }