Method divide in class DiscretePotentialOperations doesn't throw any exception when dividing by 0

Issue #37 resolved
Manuel Luque created an issue

Method with the next signature:

public static Potential divide(Potential numerator, Potential denominator)

in class DiscretePotentialOperations doesn't throw any kind of exception when dividing by a potential that contains zeros.

Moreover, it returns a potential. I'm really intrigued to know how the method divides by zero.

Comments (4)

  1. Manuel Luque reporter

    I think it's completely amazing to find these two lines of code in method divide:

    if (tDenominator.values[potentialsPositions[1]] == 0.0) { quotient.values[quotientPosition] = 0.0; }

    It basically means that someone decided in method divide that the result of dividing by zero is 0.0.

  2. Log in to comment