/** * Returns {@code true} iff the values are equal as defined by * {@link #equals(Complex,Complex,int) equals(x, y, 1)}. * * @param x First value (cannot be {@code null}). * @param y Second value (cannot be {@code null}). * @return {@code true} if the values are equal. * * @since 3.3 */ public static boolean equals(Complex x, Complex y) { return equals(x, y, 1); }
if (denominator.equals(new Complex(0.0, 0.0))) { z = z.add(new Complex(absoluteAccuracy, absoluteAccuracy)); oldz = new Complex(Double.POSITIVE_INFINITY,
@Override public boolean equals(Complex firstNumber, Complex secondNumber) { if (firstNumber.equals(secondNumber)) { return true; } else { return false; } }
/** * Returns {@code true} iff the values are equal as defined by * {@link #equals(Complex,Complex,int) equals(x, y, 1)}. * * @param x First value (cannot be {@code null}). * @param y Second value (cannot be {@code null}). * @return {@code true} if the values are equal. * * @since 3.3 */ public static boolean equals(Complex x, Complex y) { return equals(x, y, 1); }
/** * Returns {@code true} iff the values are equal as defined by * {@link #equals(Complex,Complex,int) equals(x, y, 1)}. * * @param x First value (cannot be {@code null}). * @param y Second value (cannot be {@code null}). * @return {@code true} if the values are equal. * * @since 3.3 */ public static boolean equals(Complex x, Complex y) { return equals(x, y, 1); }
/** * @param that * @param tolerance * @return */ // public boolean equals(final Complex that, final double tolerance) { // return fComplex.equals(that, tolerance); // } @Override public boolean equals(final Object obj) { if (this == obj) { return true; } if (obj instanceof ComplexNum) { return fComplex.equals(((ComplexNum) obj).fComplex); } return false; }
boolean isConjugate () { return second.equals(first.conjugate()); }
matchresult = (studentAnswerComplex != null && answerComplex.equals(studentAnswerComplex));
matchresult = (studentAnswerComplex != null && answerComplex.equals(studentAnswerComplex));
boolean isMatchedPair () { if (first.getImaginary() != 0) return second.equals(first.conjugate()); else return second.getImaginary() == 0 && second.getReal() != 0 && first.getReal() != 0; }
if (denominator.equals(new Complex(0.0, 0.0))) { z = z.add(new Complex(absoluteAccuracy, absoluteAccuracy)); oldz = new Complex(Double.POSITIVE_INFINITY,
if (denominator.equals(new Complex(0.0, 0.0))) { z = z.add(new Complex(absoluteAccuracy, absoluteAccuracy)); oldz = new Complex(Double.POSITIVE_INFINITY,