Menu

#85 Summation function

closed
nobody
None
5
2006-09-17
2004-02-24
Anonymous
No

Don't you have summation function on EasyCalc?

Discussion

  • Michael Mendelsohn

    Logged In: YES
    user_id=316541

    It's in the list functions:
    sum([1:5:7]) -> 13

    To do sum{a=1 to 5}(a^2), enter
    sum(range(5)^2)

    You could also do this in two steps:
    a=range(5)
    sum(a*a)

    "range" can have up to 3 parameters:
    range(n[:start[:step]])
    range(5) -> [1:2:3:4:5]
    range(5:0) -> [0:1:2:3:4]
    range(5:10:2) -> [10:12:14:16:18]

    Be careful with large ranges: while range(1000) worked,
    range(10000) crashed my Palm m150.

    -mendel

     
  • Ton van Overbeek

    Logged In: YES
    user_id=147684

    See mendel's comment of 2004-10-23.
    Current version (1.24) has better memory checking and should
    crash much less.

     
  • Ton van Overbeek

    • status: open --> closed
     

Log in to post a comment.

MongoDB Logo MongoDB