X-Git-Url: http://source.jalview.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fjalview%2Fext%2Fandroid%2FSparseDoubleArray.java;h=eaf059c27e163d3660f60c1d562e9320d9dea5d2;hb=80ff57c095b792b8e8e123ddb0eff4d1780d6cbd;hp=5ae5afec61f03255be3f10c4cf771202c43d4194;hpb=8fea25daa8f1f1cc564497ddf4e3c9e15a64596c;p=jalview.git diff --git a/src/jalview/ext/android/SparseDoubleArray.java b/src/jalview/ext/android/SparseDoubleArray.java index 5ae5afe..eaf059c 100644 --- a/src/jalview/ext/android/SparseDoubleArray.java +++ b/src/jalview/ext/android/SparseDoubleArray.java @@ -425,13 +425,17 @@ public class SparseDoubleArray implements Cloneable * @oparam toAdd * @return the new value for the key */ - public double multiply(int key, double d) + public double divide(int key, double divisor) { double newValue = 0d; + if (divisor == 0d) + { + return newValue; + } int i = ContainerHelpers.binarySearch(mKeys, mSize, key); if (i >= 0) { - mValues[i] *= d; + mValues[i] /= divisor; newValue = mValues[i]; } return newValue;