Tabnine Logo
Math.getExponent
Code IndexAdd Tabnine to your IDE (free)

How to use
getExponent
method
in
java.lang.Math

Best Java code snippets using java.lang.Math.getExponent (Showing top 20 results out of 576)

origin: google/guava

static boolean isNormal(double d) {
 return getExponent(d) >= MIN_EXPONENT;
}
origin: google/guava

static boolean isFinite(double d) {
 return getExponent(d) <= MAX_EXPONENT;
}
origin: prestodb/presto

static boolean isFinite(double d) {
 return getExponent(d) <= MAX_EXPONENT;
}
origin: prestodb/presto

static boolean isNormal(double d) {
 return getExponent(d) >= MIN_EXPONENT;
}
origin: google/j2objc

static boolean isFinite(double d) {
 return getExponent(d) <= MAX_EXPONENT;
}
origin: google/j2objc

static boolean isNormal(double d) {
 return getExponent(d) >= MIN_EXPONENT;
}
origin: robovm/robovm

/**
 * Returns the exponent of float {@code f}.
 * @since 1.6
 */
public static int getExponent(float f) {
  return Math.getExponent(f);
}
origin: robovm/robovm

/**
 * Returns the exponent of double {@code d}.
 * @since 1.6
 */
public static int getExponent(double d){
  return Math.getExponent(d);
}
origin: google/guava

static long getSignificand(double d) {
 checkArgument(isFinite(d), "not a normal value");
 int exponent = getExponent(d);
 long bits = doubleToRawLongBits(d);
 bits &= SIGNIFICAND_MASK;
 return (exponent == MIN_EXPONENT - 1) ? bits << 1 : bits | IMPLICIT_BIT;
}
origin: apache/incubator-druid

 @Override
 protected ExprEval eval(double param)
 {
  return ExprEval.of(Math.getExponent(param));
 }
}
origin: google/j2objc

static long getSignificand(double d) {
 checkArgument(isFinite(d), "not a normal value");
 int exponent = getExponent(d);
 long bits = doubleToRawLongBits(d);
 bits &= SIGNIFICAND_MASK;
 return (exponent == MIN_EXPONENT - 1) ? bits << 1 : bits | IMPLICIT_BIT;
}
origin: google/guava

/**
 * Returns {@code true} if {@code x} represents a mathematical integer.
 *
 * <p>This is equivalent to, but not necessarily implemented as, the expression {@code
 * !Double.isNaN(x) && !Double.isInfinite(x) && x == Math.rint(x)}.
 */
@GwtIncompatible // java.lang.Math.getExponent, com.google.common.math.DoubleUtils
public static boolean isMathematicalInteger(double x) {
 return isFinite(x)
   && (x == 0.0
     || SIGNIFICAND_BITS - Long.numberOfTrailingZeros(getSignificand(x)) <= getExponent(x));
}
origin: wildfly/wildfly

static long getSignificand(double d) {
 checkArgument(isFinite(d), "not a normal value");
 int exponent = getExponent(d);
 long bits = doubleToRawLongBits(d);
 bits &= SIGNIFICAND_MASK;
 return (exponent == MIN_EXPONENT - 1) ? bits << 1 : bits | IMPLICIT_BIT;
}
origin: prestodb/presto

static long getSignificand(double d) {
 checkArgument(isFinite(d), "not a normal value");
 int exponent = getExponent(d);
 long bits = doubleToRawLongBits(d);
 bits &= SIGNIFICAND_MASK;
 return (exponent == MIN_EXPONENT - 1) ? bits << 1 : bits | IMPLICIT_BIT;
}
origin: google/guava

/**
 * Returns the {@code BigInteger} value that is equal to {@code x} rounded with the specified
 * rounding mode, if possible.
 *
 * @throws ArithmeticException if
 *     <ul>
 *       <li>{@code x} is infinite or NaN
 *       <li>{@code x} is not a mathematical integer and {@code mode} is {@link
 *           RoundingMode#UNNECESSARY}
 *     </ul>
 */
// #roundIntermediate, java.lang.Math.getExponent, com.google.common.math.DoubleUtils
@GwtIncompatible
public static BigInteger roundToBigInteger(double x, RoundingMode mode) {
 x = roundIntermediate(x, mode);
 if (MIN_LONG_AS_DOUBLE - x < 1.0 & x < MAX_LONG_AS_DOUBLE_PLUS_ONE) {
  return BigInteger.valueOf((long) x);
 }
 int exponent = getExponent(x);
 long significand = getSignificand(x);
 BigInteger result = BigInteger.valueOf(significand).shiftLeft(exponent - SIGNIFICAND_BITS);
 return (x < 0) ? result.negate() : result;
}
origin: prestodb/presto

/**
 * Returns {@code true} if {@code x} represents a mathematical integer.
 *
 * <p>This is equivalent to, but not necessarily implemented as, the expression {@code
 * !Double.isNaN(x) && !Double.isInfinite(x) && x == Math.rint(x)}.
 */
@GwtIncompatible // java.lang.Math.getExponent, com.facebook.presto.jdbc.internal.guava.math.DoubleUtils
public static boolean isMathematicalInteger(double x) {
 return isFinite(x)
   && (x == 0.0
     || SIGNIFICAND_BITS - Long.numberOfTrailingZeros(getSignificand(x)) <= getExponent(x));
}
origin: prestodb/presto

/**
 * Returns the {@code BigInteger} value that is equal to {@code x} rounded with the specified
 * rounding mode, if possible.
 *
 * @throws ArithmeticException if
 *     <ul>
 *       <li>{@code x} is infinite or NaN
 *       <li>{@code x} is not a mathematical integer and {@code mode} is {@link
 *           RoundingMode#UNNECESSARY}
 *     </ul>
 */
// #roundIntermediate, java.lang.Math.getExponent, com.facebook.presto.jdbc.internal.guava.math.DoubleUtils
@GwtIncompatible
public static BigInteger roundToBigInteger(double x, RoundingMode mode) {
 x = roundIntermediate(x, mode);
 if (MIN_LONG_AS_DOUBLE - x < 1.0 & x < MAX_LONG_AS_DOUBLE_PLUS_ONE) {
  return BigInteger.valueOf((long) x);
 }
 int exponent = getExponent(x);
 long significand = getSignificand(x);
 BigInteger result = BigInteger.valueOf(significand).shiftLeft(exponent - SIGNIFICAND_BITS);
 return (x < 0) ? result.negate() : result;
}
origin: google/j2objc

/**
 * Returns {@code true} if {@code x} represents a mathematical integer.
 *
 * <p>This is equivalent to, but not necessarily implemented as, the expression {@code
 * !Double.isNaN(x) && !Double.isInfinite(x) && x == Math.rint(x)}.
 */
@GwtIncompatible // java.lang.Math.getExponent, com.google.common.math.DoubleUtils
public static boolean isMathematicalInteger(double x) {
 return isFinite(x)
   && (x == 0.0
     || SIGNIFICAND_BITS - Long.numberOfTrailingZeros(getSignificand(x)) <= getExponent(x));
}
origin: wildfly/wildfly

/**
 * Returns {@code true} if {@code x} represents a mathematical integer.
 *
 * <p>This is equivalent to, but not necessarily implemented as, the expression {@code
 * !Double.isNaN(x) && !Double.isInfinite(x) && x == Math.rint(x)}.
 */
@GwtIncompatible // java.lang.Math.getExponent, com.google.common.math.DoubleUtils
public static boolean isMathematicalInteger(double x) {
 return isFinite(x)
   && (x == 0.0
     || SIGNIFICAND_BITS - Long.numberOfTrailingZeros(getSignificand(x)) <= getExponent(x));
}
origin: google/guava

public static int log2(double x, RoundingMode mode) {
 checkArgument(x > 0.0 && isFinite(x), "x must be positive and finite");
 int exponent = getExponent(x);
 if (!isNormal(x)) {
  return log2(x * IMPLICIT_BIT, mode) - SIGNIFICAND_BITS;
java.langMathgetExponent

Javadoc

Returns the unbiased base-2 exponent of double d.

Popular methods of Math

  • min
    Returns the smaller of two long values. That is, the result is the argument closer to the value of L
  • max
    Returns the greater of two long values. That is, the result is the argument closer to the value of L
  • abs
    Returns the absolute value of a long value. If the argument is not negative, the argument is returne
  • round
    Returns the closest int to the argument, with ties rounding up. Special cases: * If the argument is
  • pow
    Returns the value of the first argument raised to the power of the second argument. Special cases: *
  • sqrt
    Returns the correctly rounded positive square root of a double value. Special cases: * If the argume
  • ceil
    Returns the smallest (closest to negative infinity) double value that is greater than or equal to th
  • floor
    Returns the largest (closest to positive infinity) double value that is less than or equal to the ar
  • random
    Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0. Returne
  • sin
    Returns the trigonometric sine of an angle. Special cases: * If the argument is NaN or an infinit
  • cos
    Returns the trigonometric cosine of an angle. Special cases: * If the argument is NaN or an infin
  • log
    Returns the natural logarithm (base e) of a doublevalue. Special cases: * If the argument is NaN
  • cos,
  • log,
  • exp,
  • toRadians,
  • atan2,
  • log10,
  • acos,
  • tan,
  • toDegrees,
  • atan

Popular in Java

  • Start an intent from android
  • setScale (BigDecimal)
  • addToBackStack (FragmentTransaction)
  • getResourceAsStream (ClassLoader)
  • Window (java.awt)
    A Window object is a top-level window with no borders and no menubar. The default layout for a windo
  • SocketException (java.net)
    This SocketException may be thrown during socket creation or setting options, and is the superclass
  • MessageFormat (java.text)
    Produces concatenated messages in language-neutral way. New code should probably use java.util.Forma
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • StringTokenizer (java.util)
    Breaks a string into tokens; new code should probably use String#split.> // Legacy code: StringTo
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Best plugins for Eclipse
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