Tabnine Logo
MathLib.floor
Code IndexAdd Tabnine to your IDE (free)

How to use
floor
method
in
javolution.lang.MathLib

Best Java code snippets using javolution.lang.MathLib.floor (Showing top 11 results out of 315)

origin: javolution/javolution

/**
 * Returns the closest <code>int</code> to the specified argument. 
 *
 * @param f the <code>float</code> value to be rounded to a <code>int</code>
 * @return the nearest <code>int</code> value.
 **/
public static int round(float f) {
  return (int) floor(f + 0.5f);
}
/**/
origin: org.apache.marmotta/marmotta-commons

/**
 * Returns the closest <code>long</code> to the specified argument. 
 *
 * @param d the <code>double</code> value to be rounded to a 
 *        <code>long</code>
 * @return the nearest <code>long</code> value.
 **/
public static long round(double d) {
  return (long) floor(d + 0.5d);
}
origin: javolution/javolution

/**
 * Returns the closest <code>long</code> to the specified argument. 
 *
 * @param d the <code>double</code> value to be rounded to a 
 *        <code>long</code>
 * @return the nearest <code>long</code> value.
 **/
public static long round(double d) {
  return (long) floor(d + 0.5d);
}
/**/
origin: apache/marmotta

/**
 * Returns the closest <code>long</code> to the specified argument. 
 *
 * @param d the <code>double</code> value to be rounded to a 
 *        <code>long</code>
 * @return the nearest <code>long</code> value.
 **/
public static long round(double d) {
  return (long) floor(d + 0.5d);
}
origin: org.apache.marmotta/marmotta-commons

/**
 * Returns the closest <code>int</code> to the specified argument. 
 *
 * @param f the <code>float</code> value to be rounded to a <code>int</code>
 * @return the nearest <code>int</code> value.
 **/
public static int round(float f) {
  return (int) floor(f + 0.5f);
}
origin: org.javolution/javolution-core-java

/**
 * Returns the closest <code>int</code> to the specified argument. 
 *
 * @param f the <code>float</code> value to be rounded to a <code>int</code>
 * @return the nearest <code>int</code> value.
 **/
public static int round(float f) {
  return (int) floor(f + 0.5f);
}
origin: org.javolution/javolution-core-java

/**
 * Returns the closest <code>long</code> to the specified argument. 
 *
 * @param d the <code>double</code> value to be rounded to a 
 *        <code>long</code>
 * @return the nearest <code>long</code> value.
 **/
public static long round(double d) {
  return (long) floor(d + 0.5d);
}
origin: apache/marmotta

/**
 * Returns the closest <code>int</code> to the specified argument. 
 *
 * @param f the <code>float</code> value to be rounded to a <code>int</code>
 * @return the nearest <code>int</code> value.
 **/
public static int round(float f) {
  return (int) floor(f + 0.5f);
}
origin: org.jscience/jscience

@SuppressWarnings("unchecked")
@Override
public Appendable format(Amount arg0, Appendable arg1)
    throws IOException {
  if (arg0.getUnit() instanceof Currency)
    return formatMoney(arg0, arg1);
  if (arg0.isExact()) {
    TypeFormat.format(arg0.getExactValue(), arg1);
    arg1.append(' ');
    return UnitFormat.getInstance().format(arg0.getUnit(), arg1);
  }
  double value = arg0.getEstimatedValue();
  double error = arg0.getAbsoluteError();
  int log10Value = (int) MathLib.floor(MathLib.log10(MathLib
      .abs(value)));
  int log10Error = (int) MathLib.floor(MathLib.log10(error));
  int digits = log10Value - log10Error - 1; // Exact digits.
  boolean scientific = (MathLib.abs(value) >= 1E6)
      || (MathLib.abs(value) < 1E-6);
  boolean showZeros = true;
  TypeFormat.format(value, digits, scientific, showZeros, arg1);
  arg1.append(' ');
  return UnitFormat.getInstance().format(arg0.getUnit(), arg1);
}
origin: org.jscience/jscience

int log10Value = (int) MathLib.floor(MathLib.log10(MathLib
    .abs(value)));
int log10Error = (int) MathLib.floor(MathLib.log10(error));
int digits = log10Value - log10Error - 1; // Exact digits.
digits = MathLib.max(1, digits + _errorDigits);
origin: org.jscience/jscience

int log10Value = (int) MathLib.floor(MathLib.log10(MathLib
    .abs(value)));
int log10Error = (int) MathLib.floor(MathLib.log10(error));
int digits = log10Value - log10Error - 1; // Exact digits.
digits = MathLib.max(1, digits + _errorDigits);
javolution.langMathLibfloor

Javadoc

Returns the largest (closest to positive infinity) double value that is not greater than the argument and is equal to a mathematical integer.

Popular methods of MathLib

  • min
    Returns the smaller of two long values.
  • sqrt
    Returns the positive square root of the specified value.
  • abs
    Returns the absolute value of the specified long argument.
  • bitLength
    Returns the number of bits in the minimal two's-complement representation of the specified long, exc
  • exp
    Returns #E raised to the specified power.
  • log
    Returns the natural logarithm (base #E) of the specified value.
  • max
    Returns the greater of two long values.
  • pow
    Returns the value of the first argument raised to the power of the second argument.
  • round
    Returns the closest int to the specified argument.
  • toDoublePow10
    Returns the closest double representation of the specified long number multiplied by a power of ten.
  • toDoublePow2
    Returns the closest double representation of the specified long number multiplied by a power of two.
  • toLongPow10
    Returns the closest long representation of the specified double number multiplied by a power of ten.
  • toDoublePow2,
  • toLongPow10,
  • _atan,
  • _ieee754_exp,
  • _ieee754_log,
  • asin,
  • atan,
  • digitLength,
  • floorLog10

Popular in Java

  • Reactive rest calls using spring rest template
  • notifyDataSetChanged (ArrayAdapter)
  • onRequestPermissionsResult (Fragment)
  • requestLocationUpdates (LocationManager)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • FileInputStream (java.io)
    An input stream that reads bytes from a file. File file = ...finally if (in != null) in.clos
  • URL (java.net)
    A Uniform Resource Locator that identifies the location of an Internet resource as specified by RFC
  • Collections (java.util)
    This class consists exclusively of static methods that operate on or return collections. It contains
  • LinkedHashMap (java.util)
    LinkedHashMap is an implementation of Map that guarantees iteration order. All optional operations a
  • SAXParseException (org.xml.sax)
    Encapsulate an XML parse error or warning.> This module, both source code and documentation, is in t
  • Top plugins for Android Studio
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now