next up previous
Next: String Operations Up: Expressions Previous: Type Errors

Arithmetic Operations

Integers and reals can be added, subtracted, multiplied, divided, mod-ed, and raised to each other. If the arguments to the operation are both integers, the result will be too. Otherwise, ccli with give you a real. Standard precedence rules apply. You may use parentheses wherever you need to. Here are some examples

// integer artihmetic
( 1 + 1 ) ^ 5 + 7 % 3;

// mixed
( 2.0 ^ 3 ) * ( 5.0 - 1.23E-3 ) - 1;
that evaluate to 33 and 38.990160 respectively.



Eric Klavins 2003-12-03