Changeset 4482 for trunk/library/numberlistp.lgt
- Timestamp:
- 10/04/08 12:30:36 (3 months ago)
- Files:
-
- 1 modified
-
trunk/library/numberlistp.lgt (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/library/numberlistp.lgt
r3567 r4482 3 3 4 4 :- info([ 5 version is 1. 1,5 version is 1.2, 6 6 author is 'Paulo Moura', 7 date is 200 7/4/20,7 date is 2008/9/15, 8 8 comment is 'List of numbers protocol.']). 9 9 … … 11 11 :- mode(product(+list(number), ?number), zero_or_one). 12 12 :- info(product/2, 13 [comment is 'Calculates the product of all list values.',13 [comment is 'Calculates the product of all list numbers. Fails if the list is empty.', 14 14 argnames is ['List', 'Product']]). 15 15 16 16 :- public(sum/2). 17 :- mode(sum(+list(number), ?number), zero_or_one).17 :- mode(sum(+list(number), ?number), one). 18 18 :- info(sum/2, 19 [comment is 'Calculates the sum of all list values.',19 [comment is 'Calculates the sum of all list numbers. Returns zero if the list is empty.', 20 20 argnames is ['List', 'Sum']]). 21 21 … … 23 23 :- mode(average(+list(number), ?float), zero_or_one). 24 24 :- info(average/2, 25 [comment is 'Calculates the average of a list of values.',25 [comment is 'Calculates the average (i.e. arithmetic mean) of a list of numbers. Fails if the list is empty.', 26 26 argnames is ['List', 'Average']]). 27 27
