Integer arithmetic in tcsh can be done in expressions taken by "while", "if", "exit" or the assignment command "@". Floating point arithmetic is not built in.

Example (size of integer):

#!/bin/tcsh set i=0 j=1 while ($j) @ i++ j*=2 end echo $i

Pay attention to the peculiar order of evaluation! If you type

> @ x = 1 - 1 + 1 > @ y = 2 * 1 / 2 > echo $x $y -1 0

you probably mean:

> @ x = (1 - 1) + 1 > @ y = (2 * 1) / 2 > echo $x $y 1 1