Next: , Previous: , Up: Syntax Summary   [Contents][Index]


10.10.13.2 Syntax of Arithmetic Expressions

Please note: that the Prolog arithmetic operators / and // do not mean the same thing.

N::= integer
LinExpr::= N
| var
| N * var
| N * N
| - LinExpr
| LinExpr + LinExpr
| LinExpr - LinExpr
| ConstraintBody{ if true then 1 else 0 }
Expr::= LinExpr
| - Expr
| Expr + Expr
| Expr - Expr
| Expr * Expr
| Expr / Expr{ truncated division }
| Expr // Expr{ truncated division }   since release 4.3
| Expr div Expr{ floored division }   since release 4.3
| Expr rem Expr{ truncated remainder }
| Expr mod Expr{ floored remainder }
| min(Expr,Expr)
| max(Expr,Expr)
| abs(Expr)
RelOp::= #= | #\= | #< | #=< | #> | #>=

Send feedback on this subject.