MCPcopy Index your code
hub / github.com/processing/processing / maxIndex

Method maxIndex

core/src/processing/data/FloatList.java:606–628  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

604
605
606 public int maxIndex() {
607 checkMinMax("maxIndex");
608 float m = Float.NaN;
609 int mi = -1;
610 for (int i = 0; i < count; i++) {
611 // find one good value to start
612 if (data[i] == data[i]) {
613 m = data[i];
614 mi = i;
615
616 // calculate the rest
617 for (int j = i+1; j < count; j++) {
618 float d = data[j];
619 if (!Float.isNaN(d) && (d > m)) {
620 m = data[j];
621 mi = j;
622 }
623 }
624 break;
625 }
626 }
627 return mi;
628 }
629
630
631 public float sum() {

Callers 1

maxMethod · 0.95

Calls 1

checkMinMaxMethod · 0.95

Tested by

no test coverage detected