4.3.3 int operations
--------------------

++
changes its operand to its successor, is itself no int expression
--
changes its operand to its predecessor, is itself no int expression
+
addition
-
negation or subtraction
*
multiplication
/
integer division (omitting the remainder), rounding toward 0
div
integer division (omitting the remainder >= 0)
%
integer modulo (the remainder of the division /)
mod
integer modulo (the remainder of the division div), always non-negative
^, **
exponentiation (exponent must be non-negative)
<, >, <=, >=, ==, <>
comparison

Note: An assignment j=i++; or j=i--; is not allowed,
in particular it does not change
the value of j, see Limitations.



Example:
  int i=1;
  int j;
  i++; i;  i--; i;
==> 2
==> 1
  // ++ and -- do not return a value as in C, can not assign
  j = i++;
==> // ** right side is not a datum, assignment ignored
  // the value of j is unchanged
  j; i;
==> 0
==> 2
  i+2, 2-i, 5^2;
==> 4 0 25
  5 div 2, 8%3;
==> 2 2
  -5 div 2, -5 / 2, -5 mod 2, -5 % 2;
==> -3 -2 1 -1
  1<2, 2<=2;
==> 1 1

<font size="-1">
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; User manual for <a href="http://www.singular.uni-kl.de/"><i>Singular</i></a> version 2-0-4, October 2002,
generated by <a href="http://www.gnu.org/software/texinfo/"><i>texi2html</i></a>.
</font>

</body>
</html>
