add sum_list/3
This commit is contained in:
parent
259313b603
commit
8938666bf5
@ -8716,6 +8716,12 @@ Holds when @code{append(_,Suffix,List)} holds.
|
||||
@cnindex sum_list/2
|
||||
True when @var{Numbers} is a list of numbers, and @var{Total} is their sum.
|
||||
|
||||
@item sum_list(?@var{Numbers}, +@var{SoFar}, ?@var{Total})
|
||||
@findex sum_list/3
|
||||
@syindex sum_list/3
|
||||
@cnindex sum_list/3
|
||||
True when @var{Numbers} is a list of numbers, and @var{Total} is the sum of their total plus @var{SoFar}.
|
||||
|
||||
@item sumlist(?@var{Numbers}, ?@var{Total})
|
||||
@findex sumlist/2
|
||||
@syindex sumlist/2
|
||||
|
@ -29,6 +29,7 @@
|
||||
sublist/2,
|
||||
substitute/4,
|
||||
sum_list/2,
|
||||
sum_list/3,
|
||||
suffix/2,
|
||||
sumlist/2,
|
||||
list_concat/2,
|
||||
@ -316,6 +317,9 @@ suffix(Suffix, [_|List]) :-
|
||||
sumlist(Numbers, Total) :-
|
||||
sumlist(Numbers, 0, Total).
|
||||
|
||||
sum_list(Numbers, SoFar, Total) :-
|
||||
sumlist(Numbers, SoFar, Total).
|
||||
|
||||
sum_list(Numbers, Total) :-
|
||||
sumlist(Numbers, 0, Total).
|
||||
|
||||
|
Reference in New Issue
Block a user