05-11-2015, 07:50 PM
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}
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}