BigFloat implements Comparable<BigFloat>, Serializable { public static BigFloat cosh(BigFloat x) { if (x.isNaN()) return NaN; if (x.isInfinity()) return POSITIVE_INFINITY; if (x.isZero()) return x.context.ONE; return x.context.valueOf(BigDecimalMath.cosh(x.value, x.context.mathContext)); } private  BigFloat(BigDecimal value, Context context); static Context context(int precision); static Context context(MathContext mathContext); BigFloat add(BigFloat x); BigFloat add(BigDecimal x); BigFloat add(int x); BigFloat add(long x); BigFloat add(double x); BigFloat subtract(BigFloat x); BigFloat subtract(BigDecimal x); BigFloat subtract(int x); BigFloat subtract(long x); BigFloat subtract(double x); BigFloat multiply(BigFloat x); BigFloat multiply(BigDecimal x); BigFloat multiply(int x); BigFloat multiply(long x); BigFloat multiply(double x); BigFloat divide(BigFloat x); BigFloat divide(BigDecimal x); BigFloat divide(int x); BigFloat divide(long x); BigFloat divide(double x); BigFloat remainder(BigFloat x); BigFloat remainder(BigDecimal x); BigFloat remainder(int x); BigFloat remainder(long x); BigFloat remainder(double x); BigFloat pow(BigFloat y); BigFloat pow(BigDecimal y); BigFloat pow(int y); BigFloat pow(long y); BigFloat pow(double y); BigFloat root(BigFloat y); BigFloat root(BigDecimal y); BigFloat root(int y); BigFloat root(long y); BigFloat root(double y); @Override int hashCode(); @Override boolean equals(Object obj); int signum(); boolean isNegative(); boolean isZero(); boolean isPositive(); @Override int compareTo(BigFloat other); boolean isEqual(BigFloat other); boolean isLessThan(BigFloat other); boolean isGreaterThan(BigFloat other); boolean isLessThanOrEqual(BigFloat other); boolean isGreaterThanOrEqual(BigFloat other); boolean isIntValue(); boolean isDoubleValue(); BigFloat getMantissa(); BigFloat getExponent(); BigFloat getIntegralPart(); BigFloat getFractionalPart(); Context getContext(); BigDecimal toBigDecimal(); double toDouble(); long toLong(); int toInt(); @Override String toString(); boolean isNaN(); boolean isInfinity(); static BigFloat negate(BigFloat x); static BigFloat abs(BigFloat x); static BigFloat max(BigFloat value1, BigFloat value2); static BigFloat max(BigFloat value1, BigFloat... values); static BigFloat min(BigFloat value1, BigFloat value2); static BigFloat min(BigFloat value1, BigFloat... values); static BigFloat log(BigFloat x); static BigFloat log2(BigFloat x); static BigFloat log10(BigFloat x); static BigFloat exp(BigFloat x); static BigFloat sqrt(BigFloat x); static BigFloat pow(BigFloat x, BigFloat y); static BigFloat root(BigFloat x, BigFloat y); static BigFloat sin(BigFloat x); static BigFloat cos(BigFloat x); static BigFloat tan(BigFloat x); static BigFloat cot(BigFloat x); static BigFloat asin(BigFloat x); static BigFloat acos(BigFloat x); static BigFloat atan(BigFloat x); static BigFloat acot(BigFloat x); static BigFloat sinh(BigFloat x); static BigFloat cosh(BigFloat x); static BigFloat tanh(BigFloat x); static BigFloat coth(BigFloat x); static BigFloat asinh(BigFloat x); static BigFloat acosh(BigFloat x); static BigFloat atanh(BigFloat x); static BigFloat acoth(BigFloat x); static boolean isBetween(BigFloat min, BigFloat max, BigFloat value); static final BigFloat NaN; static final BigFloat POSITIVE_INFINITY; static final BigFloat NEGATIVE_INFINITY; }
@Test public void testCosh() { Context context = context(MathContext.DECIMAL32); assertEquals(BigDecimalMath.cosh(BigDecimal.valueOf(0), MathContext.DECIMAL32), cosh(context.valueOf(0)).toBigDecimal()); assertEquals(BigDecimalMath.cosh(BigDecimal.valueOf(0.1), MathContext.DECIMAL32), cosh(context.valueOf(0.1)).toBigDecimal()); }