floor(@number) [ISO]

This arithmetic predicate finds the largest integer not greater than the value of it's argument. This predicate attempts to convert the result value to an integer.

see also: arithmetic in Prolog is/2

Examples
X is floor(1). succeeds, X is  1
X is floor(1.1). succeeds, X is 1.1
X is floor(-1.1). succeeds, X is -2

 

Exceptions
An arithmetic overflow a evaluation_error(float_overflow) exception is thrown

 

 

info@trinc-prolog.com