use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testIsRationalInfty.
@Test
public void testIsRationalInfty() {
ExtendedRational x = ExtendedRational.INFTY;
assertThat(x.isRational()).isFalse();
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testAdditionInfty.
@Test
public void testAdditionInfty() {
ExtendedRational a = new ExtendedRational(Rational.ofLongs(12, 8));
ExtendedRational b = ExtendedRational.INFTY;
assertThat(a.plus(b)).isEqualTo(ExtendedRational.INFTY);
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testDivisionInfty.
@Test
public void testDivisionInfty() {
ExtendedRational a = ExtendedRational.ofString("234234");
ExtendedRational b = ExtendedRational.INFTY;
assertThat(a.divides(b)).isEqualTo(new ExtendedRational(Rational.ofLong(0)));
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testMultiplicationZero.
@Test
public void testMultiplicationZero() {
@Var ExtendedRational a = ExtendedRational.ZERO;
@Var ExtendedRational b = ExtendedRational.NEG_INFTY;
assertThat(a.times(b)).isEqualTo(ExtendedRational.ZERO);
a = ExtendedRational.ZERO;
b = ExtendedRational.INFTY;
assertThat(a.times(b)).isEqualTo(ExtendedRational.ZERO);
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testMultiplicationNegInfty.
@Test
public void testMultiplicationNegInfty() {
ExtendedRational a = ExtendedRational.NEG_INFTY;
@Var ExtendedRational b = ExtendedRational.NEG_INFTY;
assertThat(a.times(b)).isEqualTo(ExtendedRational.INFTY);
b = ExtendedRational.INFTY;
assertThat(a.times(b)).isEqualTo(ExtendedRational.NEG_INFTY);
}
Aggregations