File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -533,6 +533,15 @@ public int maxIndex() {
533533 }
534534
535535
536+ public float sum () {
537+ double outgoing = 0 ;
538+ for (int i = 0 ; i < count ; i ++) {
539+ outgoing += data [i ];
540+ }
541+ return (float ) outgoing ;
542+ }
543+
544+
536545 /**
537546 * Sorts the array in place.
538547 *
Original file line number Diff line number Diff line change @@ -499,6 +499,15 @@ public int maxIndex() {
499499 }
500500
501501
502+ public int sum () {
503+ int outgoing = 0 ;
504+ for (int i = 0 ; i < count ; i ++) {
505+ outgoing += data [i ];
506+ }
507+ return outgoing ;
508+ }
509+
510+
502511 /**
503512 * Sorts the array in place.
504513 *
Original file line number Diff line number Diff line change @@ -18,6 +18,8 @@ X prevents speed/performance issues with old sketches on retina macs
1818X add error message for raspberry pi (and others?) about int buffers
1919X https://github.com/processing/processing/issues/2010
2020X not fixed, but made notes there about how to handle
21+ X add sum() to IntList and FloatList
22+ X https://github.com/processing/processing/issues/1893
2123
2224_ add option to have full screen span across screens
2325_ display=all in cmd line
You can’t perform that action at this time.
0 commit comments