Property | Value |
---|---|
Hex Value | $B6 |
Categories | |
Localizations |
|
sum(
Overview
Returns the sum of elements of list
from start
to end
.
Availability: Token available everywhere.
Syntax
sum(list[,start,end])
Arguments
Name | Type | Optional |
---|---|---|
list | list | |
start | Yes | |
end | Yes |
Location
2nd, list, MATH
, 5:sum(
Description
The sum( command calculates the sum of all or part of a list.
When you use it with only one argument, the list, it sums up all the elements of the list. You can also give it a bound of start and end and it will only sum up the elements starting and ending at those indices (inclusive).
sum({1,2,3,4,5})
15
sum({1,2,3,4,5},2,4)
9
sum({1,2,3,4,5},3)
12
Optimization
If the value of end is the last element of the list, it can be omitted:
sum({1,2,3,4,5},3,5)
can be
sum({1,2,3,4,5},3)
Error Conditions
- ERR:DOMAIN is thrown if the starting or ending value aren't positive integers.
- ERR:INVALID DIM is thrown if the starting or ending value exceed the size of the list, or are in the wrong order.
Related Commands
Source: parts of this page were written by the following TI|BD contributors: burr, DarkerLine, GoVegan.
History
Calculator | OS Version | Description |
---|---|---|
TI-82 | 1.0 | sum added |
TI-83 | 0.01013 | Renamed sum to sum( |
Authors: