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

How to use
toDoublePow10
method
in
javolution.lang.MathLib

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

origin: org.javolution/javolution-core-java

/**
 * Returns the largest power of 10 that is less than or equal to the
 * the specified positive value.
 *
 * @param d the <code>double</code> number.
 * @return <code>floor(Log10(abs(d)))</code>
 * @throws ArithmeticException if <code>d &lt;= 0<code> or <code>d</code>
 *         is <code>NaN</code> or <code>Infinity</code>.
 **/
public static int floorLog10(double d) {
  int guess = (int) (LOG2_DIV_LOG10 * MathLib.floorLog2(d));
  double pow10 = MathLib.toDoublePow10(1, guess);
  if ((pow10 <= d) && (pow10 * 10 > d))
    return guess;
  if (pow10 > d)
    return guess - 1;
  return guess + 1;
}
origin: org.apache.marmotta/marmotta-commons

/**
 * Returns the largest power of 10 that is less than or equal to the
 * the specified positive value.
 *
 * @param d the <code>double</code> number.
 * @return <code>floor(Log10(abs(d)))</code>
 * @throws ArithmeticException if <code>d &lt;= 0<code> or <code>d</code>
 *         is <code>NaN</code> or <code>Infinity</code>.
 **/
public static int floorLog10(double d) {
  int guess = (int) (LOG2_DIV_LOG10 * MathLib.floorLog2(d));
  double pow10 = MathLib.toDoublePow10(1, guess);
  if ((pow10 <= d) && (pow10 * 10 > d))
    return guess;
  if (pow10 > d)
    return guess - 1;
  return guess + 1;
}
origin: javolution/javolution

/**
 * Returns the largest power of 10 that is less than or equal to the
 * the specified positive value.
 *
 * @param d the <code>double</code> number.
 * @return <code>floor(Log10(abs(d)))</code>
 * @throws ArithmeticException if <code>d &lt;= 0<code> or <code>d</code>
 *         is <code>NaN</code> or <code>Infinity</code>.
 **/
public static int floorLog10(double d) {
  int guess = (int) (LOG2_DIV_LOG10 * MathLib.floorLog2(d));
  double pow10 = MathLib.toDoublePow10(1, guess);
  if ((pow10 <= d) && (pow10 * 10 > d))
    return guess;
  if (pow10 > d)
    return guess - 1;
  return guess + 1;
}
private static final double LOG2_DIV_LOG10 = 0.3010299956639811952137388947;
origin: apache/marmotta

/**
 * Returns the largest power of 10 that is less than or equal to the
 * the specified positive value.
 *
 * @param d the <code>double</code> number.
 * @return <code>floor(Log10(abs(d)))</code>
 * @throws ArithmeticException if <code>d &lt;= 0<code> or <code>d</code>
 *         is <code>NaN</code> or <code>Infinity</code>.
 **/
public static int floorLog10(double d) {
  int guess = (int) (LOG2_DIV_LOG10 * MathLib.floorLog2(d));
  double pow10 = MathLib.toDoublePow10(1, guess);
  if ((pow10 <= d) && (pow10 * 10 > d))
    return guess;
  if (pow10 > d)
    return guess - 1;
  return guess + 1;
}
origin: org.jscience/jscience

/**
 * Returns the value of this real number as a <code>double</code>.
 * 
 * @return the numeric value represented by this real after conversion
 *         to type <code>double</code>.
 */
public double doubleValue() {
  if (this == NaN)
    return Double.NaN;
  if (this == ZERO)
    return 0.0;
  // Shift the significand to a >18 digits integer (long compatible).
  int nbrDigits = _significand.digitLength();
  int digitShift = nbrDigits - 18;
  long reducedSignificand = _significand.times10pow(-digitShift).longValue();
  int exponent = _exponent + digitShift;
  return MathLib.toDoublePow10(reducedSignificand, exponent);
}
origin: org.javolution/javolution-core-java

return javolution.lang.MathLib.toDoublePow10(decimal, exp
    - fractionLength);
origin: javolution/javolution

return javolution.lang.MathLib.toDoublePow10(decimal, exp - fractionLength);
origin: javolution/javolution

  return 0.0;
if (m == Long.MIN_VALUE)
  return toDoublePow10(Long.MIN_VALUE / 10, n + 1);
if (m < 0)
  return -toDoublePow10(-m, n);
if (n >= 0) { // Positive power.
  if (n > 308)
origin: org.apache.marmotta/marmotta-commons

  return 0.0;
if (m == Long.MIN_VALUE)
  return toDoublePow10(Long.MIN_VALUE / 10, n + 1);
if (m < 0)
  return -toDoublePow10(-m, n);
if (n >= 0) { // Positive power.
  if (n > 308)
origin: org.javolution/javolution-core-java

  return 0.0;
if (m == Long.MIN_VALUE)
  return toDoublePow10(Long.MIN_VALUE / 10, n + 1);
if (m < 0)
  return -toDoublePow10(-m, n);
if (n >= 0) { // Positive power.
  if (n > 308)
origin: apache/marmotta

  return 0.0;
if (m == Long.MIN_VALUE)
  return toDoublePow10(Long.MIN_VALUE / 10, n + 1);
if (m < 0)
  return -toDoublePow10(-m, n);
if (n >= 0) { // Positive power.
  if (n > 308)
origin: org.jscience/jscience

    break;
int bracketError = (int) (error * MathLib.toDoublePow10(1,
    -log10Error + _errorDigits - 1));
tb.insert(endMantissa, Text.valueOf('[').plus(
origin: javolution/javolution

double dd = MathLib.toDoublePow10(m16, e - 16 + 1);
if (dd == d) { // 16 digits is enough.
  digits = 16;
origin: org.javolution/javolution-core-java

double dd = MathLib.toDoublePow10(m16, e - 16 + 1);
if (dd == d) { // 16 digits is enough.
  digits = 16;
javolution.langMathLibtoDoublePow10

Javadoc

Returns the closest double representation of the specified long number multiplied by a power of ten.

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.
  • floor
    Returns the largest (closest to positive infinity)double value that is not greater than the argument
  • 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.
  • 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

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • orElseThrow (Optional)
    Return the contained value, if present, otherwise throw an exception to be created by the provided s
  • scheduleAtFixedRate (ScheduledExecutorService)
  • Component (java.awt)
    A component is an object having a graphical representation that can be displayed on the screen and t
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • BigDecimal (java.math)
    An immutable arbitrary-precision signed decimal.A value is represented by an arbitrary-precision "un
  • UnknownHostException (java.net)
    Thrown when a hostname can not be resolved.
  • LinkedList (java.util)
    Doubly-linked list implementation of the List and Dequeinterfaces. Implements all optional list oper
  • CodeWhisperer alternatives
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