Dfp implements RealFieldElement<Dfp> { public Dfp power10(final int e) { Dfp d = newInstance(getOne()); if (e >= 0) { d.exp = e / 4 + 1; } else { d.exp = (e + 1) / 4; } switch ((e % 4 + 4) % 4) { case 0: break; case 1: d = d.multiply(10); break; case 2: d = d.multiply(100); break; default: d = d.multiply(1000); } return d; } 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 testPower10() { Dfp d = field.newDfp(); test(d.power10(0), field.newDfp("1"), 0, "Power10 #1"); test(d.power10(1), field.newDfp("10"), 0, "Power10 #2"); test(d.power10(2), field.newDfp("100"), 0, "Power10 #3"); test(d.power10(3), field.newDfp("1000"), 0, "Power10 #4"); test(d.power10(4), field.newDfp("10000"), 0, "Power10 #5"); test(d.power10(5), field.newDfp("100000"), 0, "Power10 #6"); test(d.power10(6), field.newDfp("1000000"), 0, "Power10 #7"); test(d.power10(7), field.newDfp("10000000"), 0, "Power10 #8"); test(d.power10(8), field.newDfp("100000000"), 0, "Power10 #9"); test(d.power10(9), field.newDfp("1000000000"), 0, "Power10 #10"); test(d.power10(-1), field.newDfp(".1"), 0, "Power10 #11"); test(d.power10(-2), field.newDfp(".01"), 0, "Power10 #12"); test(d.power10(-3), field.newDfp(".001"), 0, "Power10 #13"); test(d.power10(-4), field.newDfp(".0001"), 0, "Power10 #14"); test(d.power10(-5), field.newDfp(".00001"), 0, "Power10 #15"); test(d.power10(-6), field.newDfp(".000001"), 0, "Power10 #16"); test(d.power10(-7), field.newDfp(".0000001"), 0, "Power10 #17"); test(d.power10(-8), field.newDfp(".00000001"), 0, "Power10 #18"); test(d.power10(-9), field.newDfp(".000000001"), 0, "Power10 #19"); test(d.power10(-10), field.newDfp(".0000000001"), 0, "Power10 #20"); }