public int signum() { return OWLRealUtils.signum(_numerator); }
public int signum() { return OWLRealUtils.signum(_numerator); }
public static Rational valueOf(final String s) throws NumberFormatException { if (s == null) throw new NullPointerException(); final Matcher m = _lexicalPattern.matcher(s); if (!m.matches()) throw new NumberFormatException(s); final String sLex = m.group(1); final String nLex = m.group(2); final String dLex = m.group(3); final Number n = OWLRealUtils.getCanonicalObject(DatatypeConverter.parseInteger(sLex == null ? nLex : sLex + nLex)); final Number d = OWLRealUtils.getCanonicalObject(DatatypeConverter.parseInteger(dLex)); if (OWLRealUtils.signum(d) != 1) throw new NumberFormatException(s); return new Rational(n, d); }
public static Rational valueOf(final String s) throws NumberFormatException { if (s == null) throw new NullPointerException(); final Matcher m = _lexicalPattern.matcher(s); if (!m.matches()) throw new NumberFormatException(s); final String sLex = m.group(1); final String nLex = m.group(2); final String dLex = m.group(3); final Number n = OWLRealUtils.getCanonicalObject(DatatypeConverter.parseInteger(sLex == null ? nLex : sLex + nLex)); final Number d = OWLRealUtils.getCanonicalObject(DatatypeConverter.parseInteger(dLex)); if (OWLRealUtils.signum(d) != 1) throw new NumberFormatException(s); return new Rational(n, d); }
if (OWLRealUtils.signum(denominator) <= 0) throw new IllegalArgumentException(); if (!OWLRealUtils.isInteger(denominator))
if (OWLRealUtils.signum(denominator) <= 0) throw new IllegalArgumentException(); if (!OWLRealUtils.isInteger(denominator))