use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testIsRationalNumber.
@Test
public void testIsRationalNumber() {
ExtendedRational x = new ExtendedRational(Rational.ofLongs(23, 7));
assertThat(x.isRational()).isTrue();
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testOfStringInfty.
@Test
public void testOfStringInfty() {
ExtendedRational a = ExtendedRational.ofString("Infinity");
assertThat(a).isEqualTo(ExtendedRational.INFTY);
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testAdditionNaN.
@Test
public void testAdditionNaN() {
ExtendedRational a = new ExtendedRational(Rational.ofLongs(12, 8));
ExtendedRational b = ExtendedRational.NaN;
assertThat(a.plus(b)).isEqualTo(ExtendedRational.NaN);
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testMultiplication1.
@Test
public void testMultiplication1() {
ExtendedRational a = ExtendedRational.ofString("2/4");
ExtendedRational b = ExtendedRational.ofString("-1/3");
assertThat(a.times(b)).isEqualTo(new ExtendedRational(Rational.ofLongs(-2, 12)));
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testOfStringNaN.
@Test
public void testOfStringNaN() {
ExtendedRational a = ExtendedRational.ofString("NaN");
assertThat(a).isEqualTo(ExtendedRational.NaN);
}
Aggregations