Dfp implements RealFieldElement<Dfp> { public Dfp remainder(final Dfp d) { final Dfp result = this.subtract(this.divide(d).rint().multiply(d)); if (result.mant[mant.length-1] == 0) { result.sign = sign; } return result; } protected  Dfp(final DfpField field); protected  Dfp(final DfpField field, byte x); protected  Dfp(final DfpField field, int x); protected  Dfp(final DfpField field, long x); protected  Dfp(final DfpField field, double x);  Dfp(final Dfp d); protected  Dfp(final DfpField field, final String s); protected  Dfp(final DfpField field, final byte sign, final byte nans); Dfp newInstance(); Dfp newInstance(final byte x); Dfp newInstance(final int x); Dfp newInstance(final long x); Dfp newInstance(final double x); Dfp newInstance(final Dfp d); Dfp newInstance(final String s); Dfp newInstance(final byte sig, final byte code); DfpField getField(); int getRadixDigits(); Dfp getZero(); Dfp getOne(); Dfp getTwo(); boolean lessThan(final Dfp x); boolean greaterThan(final Dfp x); boolean negativeOrNull(); boolean strictlyNegative(); boolean positiveOrNull(); boolean strictlyPositive(); Dfp abs(); boolean isInfinite(); boolean isNaN(); boolean isZero(); @Override boolean equals(final Object other); @Override int hashCode(); boolean unequal(final Dfp x); Dfp rint(); Dfp floor(); Dfp ceil(); Dfp remainder(final Dfp d); int intValue(); int log10K(); Dfp power10K(final int e); int intLog10(); Dfp power10(final int e); Dfp add(final Dfp x); Dfp negate(); Dfp subtract(final Dfp x); Dfp multiply(final Dfp x); Dfp multiply(final int x); Dfp divide(Dfp divisor); Dfp divide(int divisor); Dfp reciprocal(); Dfp sqrt(); @Override String toString(); Dfp dotrap(int type, String what, Dfp oper, Dfp result); int classify(); static Dfp copysign(final Dfp x, final Dfp y); Dfp nextAfter(final Dfp x); double toDouble(); double[] toSplitDouble(); double getReal(); Dfp add(final double a); Dfp subtract(final double a); Dfp multiply(final double a); Dfp divide(final double a); Dfp remainder(final double a); long round(); Dfp signum(); Dfp copySign(final Dfp s); Dfp copySign(final double s); Dfp scalb(final int n); Dfp hypot(final Dfp y); Dfp cbrt(); Dfp rootN(final int n); Dfp pow(final double p); Dfp pow(final int n); Dfp pow(final Dfp e); Dfp exp(); Dfp expm1(); Dfp log(); Dfp log1p(); @Deprecated int log10(); Dfp cos(); Dfp sin(); Dfp tan(); Dfp acos(); Dfp asin(); Dfp atan(); Dfp atan2(final Dfp x); Dfp cosh(); Dfp sinh(); Dfp tanh(); Dfp acosh(); Dfp asinh(); Dfp atanh(); Dfp linearCombination(final Dfp[] a, final Dfp[] b); Dfp linearCombination(final double[] a, final Dfp[] b); Dfp linearCombination(final Dfp a1, final Dfp b1, final Dfp a2, final Dfp b2); Dfp linearCombination(final double a1, final Dfp b1, final double a2, final Dfp b2); Dfp linearCombination(final Dfp a1, final Dfp b1,
                                 final Dfp a2, final Dfp b2,
                                 final Dfp a3, final Dfp b3); Dfp linearCombination(final double a1, final Dfp b1,
                                 final double a2, final Dfp b2,
                                 final double a3, final Dfp b3); Dfp linearCombination(final Dfp a1, final Dfp b1, final Dfp a2, final Dfp b2,
                                 final Dfp a3, final Dfp b3, final Dfp a4, final Dfp b4); Dfp linearCombination(final double a1, final Dfp b1, final double a2, final Dfp b2,
                                 final double a3, final Dfp b3, final double a4, final Dfp b4); static final int RADIX; static final int MIN_EXP; static final int MAX_EXP; static final int ERR_SCALE; static final byte FINITE; static final byte INFINITE; static final byte SNAN; static final byte QNAN; }
@Test public void testRemainder() { test(field.newDfp("10").remainder(field.newDfp("3")), field.newDfp("1"), DfpField.FLAG_INEXACT, "Remainder #1"); test(field.newDfp("9").remainder(field.newDfp("3")), field.newDfp("0"), 0, "Remainder #2"); test(field.newDfp("-9").remainder(field.newDfp("3")), field.newDfp("-0"), 0, "Remainder #3"); }