use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testDivisionNumber.
@Test
public void testDivisionNumber() {
ExtendedRational a = ExtendedRational.ofString("2/4");
ExtendedRational b = ExtendedRational.ofString("1/4");
assertThat(a.divides(b)).isEqualTo(new ExtendedRational(Rational.ofLong(2)));
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testDivisionNaN.
@Test
public void testDivisionNaN() {
ExtendedRational a = ExtendedRational.ofString("234234");
ExtendedRational b = ExtendedRational.NaN;
assertThat(a.divides(b)).isEqualTo(ExtendedRational.NaN);
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testMultiplicationInfty.
@Test
public void testMultiplicationInfty() {
ExtendedRational a = ExtendedRational.ofString("100/4");
ExtendedRational b = ExtendedRational.ofString("Infinity");
assertThat(a.times(b)).isEqualTo(ExtendedRational.INFTY);
}
use of org.sosy_lab.common.rationals.ExtendedRational in project java-common-lib by sosy-lab.
the class ExtendedRationalTest method testDivisionNegInfty.
@Test
public void testDivisionNegInfty() {
ExtendedRational a = ExtendedRational.ofString("234234");
ExtendedRational b = ExtendedRational.NEG_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 testMultiplication2.
@Test
public void testMultiplication2() {
ExtendedRational a = ExtendedRational.ofString("100/4");
ExtendedRational b = ExtendedRational.ofString("1/100");
assertThat(a.times(b)).isEqualTo(new ExtendedRational(Rational.ofLongs(1, 4)));
}
Aggregations