Next: Error Handling
Up: manual
Previous: Predicates of DEC-10 Prolog
  Contents
  Index
Terms are treated as arithmetic expressions in the following contexts:
- The right-hand argument of is (e.g,
X is 1+2).
- Arguments in predicates doing arithmetic comparison
(e.g.,
X=:=1+2).
An arithmetic expression is a term built from numbers, variables, and
the following functors that represent arithmetic functions:
X + Y addition
X - Y subtraction
X * Y multiplication
X / Y division
X // Y integer division
X mod Y modulo
X ** Y exponentiation
-X sign reversal
X >> Y bit shift right
X << Y bit shift left
X /\ Y bitwise and
X \/ Y bitwise or
\ X bitewise complement
abs(X) absolution value
atan(X) arctangent(argument in radians)
ceiling(X) smallest integer not smaller than X
cos(X) cosine (argument is radians)
exp(X) natural antilogarithm,
integer(X) convert X to integer
float(X) convert X to float
floor(X) largest integer not greater than X
sign(X) sign (-1 for negative, 0 for zero, and 1 for positive)
sin(X) sine (argument in radians)
sqrt(X) square root
log(X) natural logarithm,
truncate(X) integer part of X
round(X) integer nearest to X
Next: Error Handling
Up: manual
Previous: Predicates of DEC-10 Prolog
  Contents
  Index
Neng-Fa Zhou
1999-11-24