use of ch.obermuhlner.math.big.BigFloat.Context in project big-math by eobermuhlner.
the class BigFloatTest method testIsGreaterThanOrEqual.
@Test
public void testIsGreaterThanOrEqual() {
Context context = context(MathContext.DECIMAL32);
assertEquals(true, context.valueOf(5).isGreaterThanOrEqual(context.valueOf(1)));
assertEquals(false, context.valueOf(1).isGreaterThanOrEqual(context.valueOf(5)));
assertEquals(true, context.valueOf(5).isGreaterThanOrEqual(context.valueOf(5)));
}
use of ch.obermuhlner.math.big.BigFloat.Context in project big-math by eobermuhlner.
the class BigFloatTest method testIsNegative.
@Test
public void testIsNegative() {
Context context = context(MathContext.DECIMAL32);
assertEquals(true, context.valueOf("-1E999").isNegative());
assertEquals(true, context.valueOf("-1E-999").isNegative());
assertEquals(true, context.valueOf(-5).isNegative());
assertEquals(false, context.valueOf(0).isNegative());
assertEquals(false, context.valueOf("0.000000").isNegative());
assertEquals(false, context.valueOf(5).isNegative());
assertEquals(false, context.valueOf("1E999").isNegative());
assertEquals(false, context.valueOf("1E-999").isNegative());
}
use of ch.obermuhlner.math.big.BigFloat.Context in project big-math by eobermuhlner.
the class BigFloatTest method testTan.
@Test
public void testTan() {
Context context = context(MathContext.DECIMAL32);
assertEquals(tan(context.valueOf(0)).toBigDecimal(), BigDecimalMath.tan(BigDecimal.valueOf(0), MathContext.DECIMAL32));
}
use of ch.obermuhlner.math.big.BigFloat.Context in project big-math by eobermuhlner.
the class BigFloatTest method testTanh.
@Test
public void testTanh() {
Context context = context(MathContext.DECIMAL32);
assertEquals(tanh(context.valueOf(0)).toBigDecimal(), BigDecimalMath.tanh(BigDecimal.valueOf(0), MathContext.DECIMAL32));
}
use of ch.obermuhlner.math.big.BigFloat.Context in project big-math by eobermuhlner.
the class BigFloatTest method testCos.
@Test
public void testCos() {
Context context = context(MathContext.DECIMAL32);
assertEquals(cos(context.valueOf(0)).toBigDecimal(), BigDecimalMath.cos(BigDecimal.valueOf(0), MathContext.DECIMAL32));
}
Aggregations