Search in sources :

Example 41 with Context

use of ch.obermuhlner.math.big.BigFloat.Context in project big-math by eobermuhlner.

the class BigFloatTest method testCoth.

@Test
public void testCoth() {
    Context context = context(MathContext.DECIMAL32);
    assertEquals(coth(context.valueOf(1.1)).toBigDecimal(), BigDecimalMath.coth(BigDecimal.valueOf(1.1), MathContext.DECIMAL32));
}
Also used : MathContext(java.math.MathContext) Context(ch.obermuhlner.math.big.BigFloat.Context) Test(org.junit.Test)

Example 42 with Context

use of ch.obermuhlner.math.big.BigFloat.Context in project big-math by eobermuhlner.

the class BigFloatTest method testCot.

@Test
public void testCot() {
    Context context = context(MathContext.DECIMAL32);
    assertEquals(cot(context.valueOf(1)).toBigDecimal(), BigDecimalMath.cot(BigDecimal.valueOf(1), MathContext.DECIMAL32));
}
Also used : MathContext(java.math.MathContext) Context(ch.obermuhlner.math.big.BigFloat.Context) Test(org.junit.Test)

Example 43 with Context

use of ch.obermuhlner.math.big.BigFloat.Context in project big-math by eobermuhlner.

the class BigFloatTest method testAsinh.

@Test
public void testAsinh() {
    Context context = context(MathContext.DECIMAL32);
    assertEquals(asinh(context.valueOf(0)).toBigDecimal(), BigDecimalMath.asinh(BigDecimal.valueOf(0), MathContext.DECIMAL32));
}
Also used : MathContext(java.math.MathContext) Context(ch.obermuhlner.math.big.BigFloat.Context) Test(org.junit.Test)

Example 44 with Context

use of ch.obermuhlner.math.big.BigFloat.Context in project big-math by eobermuhlner.

the class BigFloatTest method testAtan.

@Test
public void testAtan() {
    Context context = context(MathContext.DECIMAL32);
    assertEquals(atan(context.valueOf(0)).toBigDecimal(), BigDecimalMath.atan(BigDecimal.valueOf(0), MathContext.DECIMAL32));
}
Also used : MathContext(java.math.MathContext) Context(ch.obermuhlner.math.big.BigFloat.Context) Test(org.junit.Test)

Example 45 with Context

use of ch.obermuhlner.math.big.BigFloat.Context in project big-math by eobermuhlner.

the class BigFloatTest method testMin.

@Test
public void testMin() {
    Context context = context(MathContext.DECIMAL32);
    assertEquals(context.valueOf(1), min(context.valueOf(1), context.valueOf(2)));
    assertEquals(context.valueOf(1), min(context.valueOf(2), context.valueOf(1)));
    assertEquals(context.valueOf(1), min(context.valueOf(2), context.valueOf(1), context.valueOf(3)));
    assertEquals(context.valueOf(1), min(context.valueOf(1), context.valueOf(2), context.valueOf(3)));
}
Also used : MathContext(java.math.MathContext) Context(ch.obermuhlner.math.big.BigFloat.Context) Test(org.junit.Test)

Aggregations

Context (ch.obermuhlner.math.big.BigFloat.Context)78 Test (org.junit.Test)76 MathContext (java.math.MathContext)61 BigFloat (ch.obermuhlner.math.big.BigFloat)15