Post Reply 
Problems with the command cumSum and Workaround
05-11-2015, 07:50 PM (This post was last modified: 05-11-2015 08:00 PM by Eddie W. Shore.)
Post: #1
Problems with the command cumSum and Workaround
Example: store {10, 20, 10} to L1

cumSum(L1):

sometimes returns {10, 40, Nan}
sometimes returns {10, 30, 40} (the right answer)
sometimes causes the calcualtor to crash

Software Version 6975


Here is a possible workaround:
CSUM(list)
BEGIN
LOCAL k;
FOR k FROM 2 TO SIZE(list) DO
list[k]:=list[k]+list[k-1];
END;
RETURN list;
END;

CSUM({10,20.10}) returns {10,30,40}
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
Problems with the command cumSum and Workaround - Eddie W. Shore - 05-11-2015 07:50 PM



User(s) browsing this thread: 1 Guest(s)