Browse Source

BigRational: add isInteger method

git-svn-id: https://www.prismmodelchecker.org/svn/prism/prism/trunk@11554 bbc10eb1-c90d-0410-af57-cb519fbb1720
master
Joachim Klein 10 years ago
parent
commit
427844cfd1
  1. 12
      prism/src/param/BigRational.java

12
prism/src/param/BigRational.java

@ -774,6 +774,18 @@ public final class BigRational implements Comparable<BigRational>
return !isNaN() && !isInf() && !isMInf();
}
/**
* Returns true iff this object represents an integer, i.e.,
* is not not-a-number, positive, or negative infinity and
* the denominator is 1.
*
* @return true iff this object represents an integer
*/
public boolean isInteger()
{
return isRational() && getDen().equals(ONE);
}
/**
* Returns true iff this value represents a special number.
* This is the case if this is either not-a-number, positive or

Loading…
Cancel
Save