next up previous contents index
Next: Error Handling Up: manual Previous: Predicates of DEC-10 Prolog   Contents   Index

Arithmetic

Terms are treated as arithmetic expressions in the following contexts: 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, $e^X$
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, $log_eX$
truncate(X) integer part of X
round(X) integer nearest to X


next up previous contents index
Next: Error Handling Up: manual Previous: Predicates of DEC-10 Prolog   Contents   Index
Neng-Fa Zhou
1999-11-24