Browse Source

param.BigRational: add lessThan, lessThanEquals, greaterThan, greaterThanEquals

master
Joachim Klein 8 years ago
committed by Dave Parker
parent
commit
ccf03fb633
  1. 24
      prism/src/param/BigRational.java

24
prism/src/param/BigRational.java

@ -700,6 +700,30 @@ public final class BigRational extends Number implements Comparable<BigRational>
return this.compareTo(new BigRational(i));
}
/** Returns true if this number is less than the other number */
public boolean lessThan(BigRational other)
{
return this.compareTo(other) < 0;
}
/** Returns true if this number is less than or equal the other number */
public boolean lessThanEquals(BigRational other)
{
return this.compareTo(other) <= 0;
}
/** Returns true if this number is greater than the other number */
public boolean greaterThan(BigRational other)
{
return this.compareTo(other) > 0;
}
/** Returns true if this number is greater than or equal the other number */
public boolean greaterThanEquals(BigRational other)
{
return this.compareTo(other) >= 0;
}
/**
* Return numerator of this BigRational as a BigInteger.
*

Loading…
Cancel
Save