object

natural

Natural numbers data type predicates.

Availability:
logtalk_load(types(loader))
Author: Paulo Moura
Version: 2:0:0
Date: 2026-02-02
Compilation flags:
static, context_switching_calls
Extends:
public integer
Remarks:
(none)

Public predicates

factorial/2

Computes the factorial of a non-negative integer.

Compilation flags:
static
Template:
factorial(N,Factorial)
Mode and number of proofs:
factorial(+non_negative_integer,-non_negative_integer) - one

binomial/3

Computes the binomial coefficient. N must be greater than or equal to K (fails otherwise).

Compilation flags:
static
Template:
binomial(N,K,Binomial)
Mode and number of proofs:
binomial(+non_negative_integer,+non_negative_integer,-non_negative_integer) - zero_or_one

Protected predicates

(no local declarations; see entity ancestors if any)

Private predicates

(no local declarations; see entity ancestors if any)

Operators

(none)