Codota Logo
OWLRealUtils.shrinkBigInteger
Code IndexAdd Codota to your IDE (free)

How to use
shrinkBigInteger
method
in
openllet.core.datatypes.OWLRealUtils

Best Java code snippets using openllet.core.datatypes.OWLRealUtils.shrinkBigInteger (Showing top 16 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
FileOutputStream f =
  • Codota IconFile file;new FileOutputStream(file)
  • Codota IconString name;new FileOutputStream(name)
  • Codota IconFile file;new FileOutputStream(file, true)
  • Smart code suggestions by Codota
}
origin: Galigator/openllet

public static Number integerSum(final Number a, final Number b)
{
  final Type ta = Type.get(a.getClass());
  final Type tb = Type.get(b.getClass());
  if (ta == null || tb == null)
  {
    final String msg = format("Unexpected number type %s,%s passed to integerSum method.", a.getClass().getCanonicalName(), b.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  final BigInteger ia = bigInteger(a);
  final BigInteger ib = bigInteger(b);
  return shrinkBigInteger(ia.add(ib));
}
origin: Galigator/openllet

public static Number integerSum(final Number a, final Number b)
{
  final Type ta = Type.get(a.getClass());
  final Type tb = Type.get(b.getClass());
  if (ta == null || tb == null)
  {
    final String msg = format("Unexpected number type %s,%s passed to integerSum method.", a.getClass().getCanonicalName(), b.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  final BigInteger ia = bigInteger(a);
  final BigInteger ib = bigInteger(b);
  return shrinkBigInteger(ia.add(ib));
}
origin: Galigator/openllet

public static Number integerDifference(final Number a, final Number b)
{
  final Type ta = Type.get(a.getClass());
  final Type tb = Type.get(b.getClass());
  if (ta == null || tb == null)
  {
    final String msg = format("Unexpected number type %s,%s passed to integerDifference method.", a.getClass().getCanonicalName(), b.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  final BigInteger ia = bigInteger(a);
  final BigInteger ib = bigInteger(b);
  return shrinkBigInteger(ia.subtract(ib));
}
origin: Galigator/openllet

public static Number integerDifference(final Number a, final Number b)
{
  final Type ta = Type.get(a.getClass());
  final Type tb = Type.get(b.getClass());
  if (ta == null || tb == null)
  {
    final String msg = format("Unexpected number type %s,%s passed to integerDifference method.", a.getClass().getCanonicalName(), b.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  final BigInteger ia = bigInteger(a);
  final BigInteger ib = bigInteger(b);
  return shrinkBigInteger(ia.subtract(ib));
}
origin: Galigator/openllet

  return shrinkBigInteger(bigInteger(n).add(BigInteger.ONE));
else
origin: Galigator/openllet

  return shrinkBigInteger(bigInteger(n).subtract(BigInteger.ONE));
else
origin: Galigator/openllet

  return shrinkBigInteger(bigInteger(n).add(BigInteger.ONE));
else
origin: Galigator/openllet

  return shrinkBigInteger(bigInteger(n).subtract(BigInteger.ONE));
else
origin: Galigator/openllet

public static Number roundCeiling(final Number n)
{
  final Type t = Type.get(n.getClass());
  if (t == null)
  {
    final String msg = format("Unexpected number type %s passed to roundDown method.", n.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  if (t.isIntegerOnly())
    return n;
  if (Type.BIG_DECIMAL.equals(t))
  {
    final BigDecimal d = (BigDecimal) n;
    final BigDecimal[] dandr = d.divideAndRemainder(BigDecimal.ONE);
    if (dandr[1].equals(BigDecimal.ZERO) || d.signum() == -1)
      return shrinkBigInteger(dandr[0].toBigIntegerExact());
    else
      return shrinkBigInteger(dandr[0].toBigIntegerExact().add(BigInteger.ONE));
  }
  else
    if (Type.RATIONAL.equals(t))
    {
      final Rational r = (Rational) n;
      return roundCeiling(r.getQuotient());
    }
    else
      throw new IllegalStateException();
}
origin: Galigator/openllet

public static Number roundFloor(final Number n)
{
  final Type t = Type.get(n.getClass());
  if (t == null)
  {
    final String msg = format("Unexpected number type %s passed to roundDown method.", n.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  if (t.isIntegerOnly())
    return n;
  if (Type.BIG_DECIMAL.equals(t))
  {
    final BigDecimal d = (BigDecimal) n;
    final BigDecimal[] dandr = d.divideAndRemainder(BigDecimal.ONE);
    if (dandr[1].equals(BigDecimal.ZERO) || d.signum() == 1)
      return shrinkBigInteger(dandr[0].toBigIntegerExact());
    else
      return shrinkBigInteger(dandr[0].toBigIntegerExact().subtract(BigInteger.ONE));
  }
  else
    if (Type.RATIONAL.equals(t))
    {
      final Rational r = (Rational) n;
      return roundFloor(r.getQuotient());
    }
    else
      throw new IllegalStateException();
}
origin: Galigator/openllet

public static Number roundCeiling(final Number n)
{
  final Type t = Type.get(n.getClass());
  if (t == null)
  {
    final String msg = format("Unexpected number type %s passed to roundDown method.", n.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  if (t.isIntegerOnly())
    return n;
  if (Type.BIG_DECIMAL.equals(t))
  {
    final BigDecimal d = (BigDecimal) n;
    final BigDecimal[] dandr = d.divideAndRemainder(BigDecimal.ONE);
    if (dandr[1].equals(BigDecimal.ZERO) || d.signum() == -1)
      return shrinkBigInteger(dandr[0].toBigIntegerExact());
    else
      return shrinkBigInteger(dandr[0].toBigIntegerExact().add(BigInteger.ONE));
  }
  else
    if (Type.RATIONAL.equals(t))
    {
      final Rational r = (Rational) n;
      return roundCeiling(r.getQuotient());
    }
    else
      throw new IllegalStateException();
}
origin: Galigator/openllet

public static Number roundFloor(final Number n)
{
  final Type t = Type.get(n.getClass());
  if (t == null)
  {
    final String msg = format("Unexpected number type %s passed to roundDown method.", n.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  if (t.isIntegerOnly())
    return n;
  if (Type.BIG_DECIMAL.equals(t))
  {
    final BigDecimal d = (BigDecimal) n;
    final BigDecimal[] dandr = d.divideAndRemainder(BigDecimal.ONE);
    if (dandr[1].equals(BigDecimal.ZERO) || d.signum() == 1)
      return shrinkBigInteger(dandr[0].toBigIntegerExact());
    else
      return shrinkBigInteger(dandr[0].toBigIntegerExact().subtract(BigInteger.ONE));
  }
  else
    if (Type.RATIONAL.equals(t))
    {
      final Rational r = (Rational) n;
      return roundFloor(r.getQuotient());
    }
    else
      throw new IllegalStateException();
}
origin: Galigator/openllet

public static Number roundDown(final Number n)
{
  final Type t = Type.get(n.getClass());
  if (t == null)
  {
    final String msg = format("Unexpected number type %s passed to roundDown method.", n.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  if (t.isIntegerOnly())
    return n;
  if (Type.BIG_DECIMAL.equals(t))
  {
    final BigDecimal d = (BigDecimal) n;
    return shrinkBigInteger(d.divideToIntegralValue(BigDecimal.ONE).toBigIntegerExact());
  }
  else
    if (Type.RATIONAL.equals(t))
    {
      final Rational r = (Rational) n;
      return roundDown(r.getQuotient());
    }
    else
      throw new IllegalStateException();
}
origin: Galigator/openllet

public static Number roundDown(final Number n)
{
  final Type t = Type.get(n.getClass());
  if (t == null)
  {
    final String msg = format("Unexpected number type %s passed to roundDown method.", n.getClass().getCanonicalName());
    _logger.warning(msg);
    throw new IllegalArgumentException(msg);
  }
  if (t.isIntegerOnly())
    return n;
  if (Type.BIG_DECIMAL.equals(t))
  {
    final BigDecimal d = (BigDecimal) n;
    return shrinkBigInteger(d.divideToIntegralValue(BigDecimal.ONE).toBigIntegerExact());
  }
  else
    if (Type.RATIONAL.equals(t))
    {
      final Rational r = (Rational) n;
      return roundDown(r.getQuotient());
    }
    else
      throw new IllegalStateException();
}
origin: Galigator/openllet

  return shrinkBigInteger(bigInteger(n));
else
  if (Type.RATIONAL.equals(t))
origin: Galigator/openllet

  return shrinkBigInteger(bigInteger(n));
else
  if (Type.RATIONAL.equals(t))
openllet.core.datatypesOWLRealUtilsshrinkBigInteger

Javadoc

Shrink an integer to the smallest supporting typef

Popular methods of OWLRealUtils

  • compare
  • getCanonicalObject
  • isInteger
  • acceptable
  • bigDecimal
  • bigInteger
  • convertFromTo
  • integerDecrement
  • integerDifference
  • integerIncrement
  • integerSum
  • isDecimal
  • integerSum,
  • isDecimal,
  • isRational,
  • print,
  • roundCeiling,
  • roundDown,
  • roundFloor,
  • signum,
  • sum

Popular in Java

  • Making http requests using okhttp
  • scheduleAtFixedRate (ScheduledExecutorService)
  • notifyDataSetChanged (ArrayAdapter)
  • setContentView (Activity)
  • ObjectMapper (com.fasterxml.jackson.databind)
    This mapper (or, data binder, or codec) provides functionality for converting between Java objects (
  • MalformedURLException (java.net)
    Thrown to indicate that a malformed URL has occurred. Either no legal protocol could be found in a s
  • Arrays (java.util)
    This class contains various methods for manipulating arrays (such as sorting and searching). This cl
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • Servlet (javax.servlet)
    Defines methods that all servlets must implement.A servlet is a small Java program that runs within
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now