protocol

numberlistp

List of numbers protocol.

author:
Paulo Moura
version:
1.2
date:
2008/9/15
compilation:
static, context_switching_calls

(no dependencies on other files)

Public interface

product/2

Calculates the product of all list numbers. Fails if the list is empty.

compilation:
static
template:
product(List,Product)
mode – number of solutions:
product(+list(number),?number) – zero_or_one

sum/2

Calculates the sum of all list numbers. Returns zero if the list is empty.

compilation:
static
template:
sum(List,Sum)
mode – number of solutions:
sum(+list(number),?number) – one

average/2

Calculates the average (i.e. arithmetic mean) of a list of numbers. Fails if the list is empty.

compilation:
static
template:
average(List,Average)
mode – number of solutions:
average(+list(number),?float) – zero_or_one

Protected interface

(none)

Private predicates

(none)

Remarks

(none)