Unary functions¶
Unary functions take a single main argument and return a value or a condition derived from it.
The following functions are available:
See also
See Constraint Programming functions for a general explanation on how to read the signature tables below.
not¶
Returns the logical negation of its operand: not(e) = 1 - e.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
boolean (dimension 0 or 1) |
Mandatory |
floor¶
Rounds its operand down to the largest integer that is less than or equal to it.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
numeric (dimension 0 or 1) |
Mandatory |
ceil¶
Rounds its operand up to the smallest integer that is greater than or equal to it.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
numeric (dimension 0 or 1) |
Mandatory |
round¶
Rounds its operand to the nearest integer, equivalent to floor(x + 0.5).
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
numeric (dimension 0 or 1) |
Mandatory |
start¶
Returns the start of aninterval.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
interval (dimension 0 or 1) |
Mandatory |
end¶
Returns the end of an interval.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
interval (dimension 0 or 1) |
Mandatory |
length¶
Returns the length of an interval, equal to the difference between its end and its start.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
interval (dimension 0 or 1) |
Mandatory |
isPresent¶
Returns 1 if the interval is present (only for optional intervals), and 0 otherwise.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
interval (dimension 0 or 1) |
Mandatory |
count¶
Returns the number of elements contained in a collection, array or interval. In the interval case, the count is equal to the length of the interval.
Parameters
Parameter |
Description |
Requirement |
|---|---|---|
Argument 1 |
any (dimension greater than 0) |
Mandatory |