unifies the first argument with the value of the second argument.
is/2 evaluates Expression and unifies Result with the resulting value.
is/2 is a predefined infix-operator. Its priority is 700 and it is non-associative (see also current_op/3).
Result number Expression evaluable
Possible arguments are the following functors or operations:
(the type-representations are:
'F' means 'only floating point number'
'R' means 'floating point number or integer'
'I' means 'integer'
| Functor or operation | Type of result | description |
|---|---|---|
| - F | F | negates a number. |
| - I | I | negates a number. |
| F - R | F | subtracts the second argument from the first one |
| R - F | F | subtracts the second argument from the first one |
| I - I | I | subtracts the second argument from the first one |
| F + R | F | adds two numbers |
| R + F | F | adds two numbers |
| I + I | I | adds two numbers |
| R / R | F | divides the first argument through the second argument |
| I // I | I | divides the first argument through the second argument |
| R * F | F | multiplies two numbers |
| F * R | F | multiplies two numbers |
| I * I | I | multiplies two numbers |
| abs(F) | F | absolute value of a number |
| abs(I) | I | absolute value of a number |
| acos(R) | F | arcus cosinus of a number |
| asin(R) | F | arcus sinus of a number |
| atan(R) | F | arcus tangens of a number |
| ceil(R) | I | rounds a number up |
| ceiling(R) | I | rounds a number up (same as ceil) |
| cos(R) | F | cosinus |
| exp(R) | F | exponential function of a number |
| floor(R) | I | rounds a number off |
| log(F) | F | natural logarithm of a number |
| max(R,R) | R | maximum of two numbers |
| min(R,R) | R | minimum of two numbers |
| I mod I | I | first argument modulo second argument |
| R ** R | R | first argument power second argument (same as pow) |
| pow(R,R) | R | first argument power second argument |
| round(R) | I | rounds a number |
| sin(R) | F | sinus of a number |
| sqrt(R) | F | square-root of a number |
| tan(R) | F | tangens of a number |
| I << I | I | bitwise shift left |
| I >> I | I | bitwise shift right |
| \ I | I | bitwise complement |
| I >>> I | I | unsigned bitwise shift right |
| X is 15 * 2. | Succeeds with substitution X <- 30. |
| Y is 17.5 - 2. | Succeeds with substitution Y <- 15.5. |
| 5.0 is 5. | Fails. |
| X is Y+4. | instantiation_error. |
This predicate is part of the ISO-Prolog Standard.
| scroll to top |
|