Class StrictMath

java.lang.Object
java.lang.StrictMath

public final class StrictMath extends Object
The JDK's StrictMath. Every member answers exactly as the Math member of the same name: this runtime has one implementation of each function, so the results are the same on every platform it runs on, which is what StrictMath promises.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final double
    As Math.E.
    static final double
    As Math.PI.
    static final double
    As Math.TAU.
  • Method Summary

    Modifier and Type
    Method
    Description
    static double
    abs(double a)
    As Math.abs.
    static float
    abs(float a)
    As Math.abs.
    static int
    abs(int a)
    As Math.abs.
    static long
    abs(long a)
    As Math.abs.
    static int
    absExact(int a)
    As Math.absExact.
    static long
    absExact(long a)
    As Math.absExact.
    static int
    addExact(int a, int b)
    As Math.addExact.
    static long
    addExact(long a, long b)
    As Math.addExact.
    static double
    cbrt(double a)
    As Math.cbrt.
    static double
    ceil(double a)
    As Math.ceil.
    static int
    ceilDiv(int a, int b)
    As Math.ceilDiv.
    static long
    ceilDiv(long a, int b)
    As Math.ceilDiv.
    static long
    ceilDiv(long a, long b)
    As Math.ceilDiv.
    static int
    ceilDivExact(int a, int b)
    As Math.ceilDivExact.
    static long
    ceilDivExact(long a, long b)
    As Math.ceilDivExact.
    static int
    ceilMod(int a, int b)
    As Math.ceilMod.
    static int
    ceilMod(long a, int b)
    As Math.ceilMod.
    static long
    ceilMod(long a, long b)
    As Math.ceilMod.
    static double
    clamp(double a, double b, double c)
    As Math.clamp.
    static float
    clamp(float a, float b, float c)
    As Math.clamp.
    static int
    clamp(long a, int b, int c)
    As Math.clamp.
    static long
    clamp(long a, long b, long c)
    As Math.clamp.
    static double
    copySign(double a, double b)
    As Math.copySign.
    static float
    copySign(float a, float b)
    As Math.copySign.
    static double
    cos(double a)
    As Math.cos.
    static double
    cosh(double a)
    As Math.cosh.
    static int
    As Math.decrementExact.
    static long
    As Math.decrementExact.
    static int
    divideExact(int a, int b)
    As Math.divideExact.
    static long
    divideExact(long a, long b)
    As Math.divideExact.
    static double
    floor(double a)
    As Math.floor.
    static int
    floorDiv(int a, int b)
    As Math.floorDiv.
    static long
    floorDiv(long a, int b)
    As Math.floorDiv.
    static long
    floorDiv(long a, long b)
    As Math.floorDiv.
    static int
    floorDivExact(int a, int b)
    As Math.floorDivExact.
    static long
    floorDivExact(long a, long b)
    As Math.floorDivExact.
    static int
    floorMod(int a, int b)
    As Math.floorMod.
    static int
    floorMod(long a, int b)
    As Math.floorMod.
    static long
    floorMod(long a, long b)
    As Math.floorMod.
    static int
    getExponent(double a)
    As Math.getExponent.
    static int
    getExponent(float a)
    As Math.getExponent.
    static double
    hypot(double a, double b)
    As Math.hypot.
    static int
    As Math.incrementExact.
    static long
    As Math.incrementExact.
    static double
    max(double a, double b)
    As Math.max.
    static float
    max(float a, float b)
    As Math.max.
    static int
    max(int a, int b)
    As Math.max.
    static long
    max(long a, long b)
    As Math.max.
    static double
    min(double a, double b)
    As Math.min.
    static float
    min(float a, float b)
    As Math.min.
    static int
    min(int a, int b)
    As Math.min.
    static long
    min(long a, long b)
    As Math.min.
    static int
    multiplyExact(int a, int b)
    As Math.multiplyExact.
    static long
    multiplyExact(long a, int b)
    As Math.multiplyExact.
    static long
    multiplyExact(long a, long b)
    As Math.multiplyExact.
    static long
    multiplyFull(int a, int b)
    As Math.multiplyFull.
    static long
    multiplyHigh(long a, long b)
    As Math.multiplyHigh.
    static int
    negateExact(int a)
    As Math.negateExact.
    static long
    negateExact(long a)
    As Math.negateExact.
    static double
    nextAfter(double a, double b)
    As Math.nextAfter.
    static float
    nextAfter(float a, double b)
    As Math.nextAfter.
    static double
    nextDown(double a)
    As Math.nextDown.
    static float
    nextDown(float a)
    As Math.nextDown.
    static double
    nextUp(double a)
    As Math.nextUp.
    static float
    nextUp(float a)
    As Math.nextUp.
    static double
    As Math.random.
    static double
    rint(double a)
    As Math.rint.
    static long
    round(double a)
    As Math.round.
    static int
    round(float a)
    As Math.round.
    static double
    scalb(double a, int b)
    As Math.scalb.
    static float
    scalb(float a, int b)
    As Math.scalb.
    static double
    signum(double a)
    As Math.signum.
    static float
    signum(float a)
    As Math.signum.
    static double
    sin(double a)
    As Math.sin.
    static double
    sinh(double a)
    As Math.sinh.
    static double
    sqrt(double a)
    As Math.sqrt.
    static int
    subtractExact(int a, int b)
    As Math.subtractExact.
    static long
    subtractExact(long a, long b)
    As Math.subtractExact.
    static double
    tan(double a)
    As Math.tan.
    static double
    tanh(double a)
    As Math.tanh.
    static double
    toDegrees(double a)
    As Math.toDegrees.
    static int
    toIntExact(long a)
    As Math.toIntExact.
    static double
    toRadians(double a)
    As Math.toRadians.
    static double
    ulp(double a)
    As Math.ulp.
    static float
    ulp(float a)
    As Math.ulp.
    static long
    unsignedMultiplyHigh(long a, long b)
    As Math.unsignedMultiplyHigh.

    Methods inherited from class Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

  • Method Details

    • abs

      public static double abs(double a)
      As Math.abs.
    • abs

      public static float abs(float a)
      As Math.abs.
    • abs

      public static int abs(int a)
      As Math.abs.
    • abs

      public static long abs(long a)
      As Math.abs.
    • ceil

      public static double ceil(double a)
      As Math.ceil.
    • cos

      public static double cos(double a)
      As Math.cos.
    • floor

      public static double floor(double a)
      As Math.floor.
    • max

      public static double max(double a, double b)
      As Math.max.
    • max

      public static float max(float a, float b)
      As Math.max.
    • max

      public static int max(int a, int b)
      As Math.max.
    • max

      public static long max(long a, long b)
      As Math.max.
    • min

      public static double min(double a, double b)
      As Math.min.
    • min

      public static float min(float a, float b)
      As Math.min.
    • min

      public static int min(int a, int b)
      As Math.min.
    • min

      public static long min(long a, long b)
      As Math.min.
    • sin

      public static double sin(double a)
      As Math.sin.
    • sqrt

      public static double sqrt(double a)
      As Math.sqrt.
    • tan

      public static double tan(double a)
      As Math.tan.
    • toDegrees

      public static double toDegrees(double a)
      As Math.toDegrees.
    • toRadians

      public static double toRadians(double a)
      As Math.toRadians.
    • round

      public static long round(double a)
      As Math.round.
    • round

      public static int round(float a)
      As Math.round.
    • nextDown

      public static double nextDown(double a)
      As Math.nextDown.
    • nextAfter

      public static double nextAfter(double a, double b)
      As Math.nextAfter.
    • nextAfter

      public static float nextAfter(float a, double b)
      As Math.nextAfter.
    • random

      public static double random()
      As Math.random.
    • signum

      public static double signum(double a)
      As Math.signum.
    • signum

      public static float signum(float a)
      As Math.signum.
    • copySign

      public static double copySign(double a, double b)
      As Math.copySign.
    • copySign

      public static float copySign(float a, float b)
      As Math.copySign.
    • getExponent

      public static int getExponent(double a)
      As Math.getExponent.
    • getExponent

      public static int getExponent(float a)
      As Math.getExponent.
    • ulp

      public static double ulp(double a)
      As Math.ulp.
    • ulp

      public static float ulp(float a)
      As Math.ulp.
    • nextUp

      public static double nextUp(double a)
      As Math.nextUp.
    • nextUp

      public static float nextUp(float a)
      As Math.nextUp.
    • nextDown

      public static float nextDown(float a)
      As Math.nextDown.
    • scalb

      public static double scalb(double a, int b)
      As Math.scalb.
    • scalb

      public static float scalb(float a, int b)
      As Math.scalb.
    • hypot

      public static double hypot(double a, double b)
      As Math.hypot.
    • cbrt

      public static double cbrt(double a)
      As Math.cbrt.
    • rint

      public static double rint(double a)
      As Math.rint.
    • sinh

      public static double sinh(double a)
      As Math.sinh.
    • cosh

      public static double cosh(double a)
      As Math.cosh.
    • tanh

      public static double tanh(double a)
      As Math.tanh.
    • floorDiv

      public static int floorDiv(int a, int b)
      As Math.floorDiv.
    • floorDiv

      public static long floorDiv(long a, int b)
      As Math.floorDiv.
    • floorDiv

      public static long floorDiv(long a, long b)
      As Math.floorDiv.
    • floorMod

      public static int floorMod(int a, int b)
      As Math.floorMod.
    • floorMod

      public static int floorMod(long a, int b)
      As Math.floorMod.
    • floorMod

      public static long floorMod(long a, long b)
      As Math.floorMod.
    • ceilDiv

      public static int ceilDiv(int a, int b)
      As Math.ceilDiv.
    • ceilDiv

      public static long ceilDiv(long a, int b)
      As Math.ceilDiv.
    • ceilDiv

      public static long ceilDiv(long a, long b)
      As Math.ceilDiv.
    • ceilMod

      public static int ceilMod(int a, int b)
      As Math.ceilMod.
    • ceilMod

      public static int ceilMod(long a, int b)
      As Math.ceilMod.
    • ceilMod

      public static long ceilMod(long a, long b)
      As Math.ceilMod.
    • divideExact

      public static int divideExact(int a, int b)
      As Math.divideExact.
    • divideExact

      public static long divideExact(long a, long b)
      As Math.divideExact.
    • floorDivExact

      public static int floorDivExact(int a, int b)
      As Math.floorDivExact.
    • floorDivExact

      public static long floorDivExact(long a, long b)
      As Math.floorDivExact.
    • ceilDivExact

      public static int ceilDivExact(int a, int b)
      As Math.ceilDivExact.
    • ceilDivExact

      public static long ceilDivExact(long a, long b)
      As Math.ceilDivExact.
    • addExact

      public static int addExact(int a, int b)
      As Math.addExact.
    • addExact

      public static long addExact(long a, long b)
      As Math.addExact.
    • subtractExact

      public static int subtractExact(int a, int b)
      As Math.subtractExact.
    • subtractExact

      public static long subtractExact(long a, long b)
      As Math.subtractExact.
    • multiplyExact

      public static int multiplyExact(int a, int b)
      As Math.multiplyExact.
    • multiplyExact

      public static long multiplyExact(long a, int b)
      As Math.multiplyExact.
    • multiplyExact

      public static long multiplyExact(long a, long b)
      As Math.multiplyExact.
    • multiplyFull

      public static long multiplyFull(int a, int b)
      As Math.multiplyFull.
    • multiplyHigh

      public static long multiplyHigh(long a, long b)
      As Math.multiplyHigh.
    • unsignedMultiplyHigh

      public static long unsignedMultiplyHigh(long a, long b)
      As Math.unsignedMultiplyHigh.
    • incrementExact

      public static int incrementExact(int a)
      As Math.incrementExact.
    • incrementExact

      public static long incrementExact(long a)
      As Math.incrementExact.
    • decrementExact

      public static int decrementExact(int a)
      As Math.decrementExact.
    • decrementExact

      public static long decrementExact(long a)
      As Math.decrementExact.
    • negateExact

      public static int negateExact(int a)
      As Math.negateExact.
    • negateExact

      public static long negateExact(long a)
      As Math.negateExact.
    • toIntExact

      public static int toIntExact(long a)
      As Math.toIntExact.
    • absExact

      public static int absExact(int a)
      As Math.absExact.
    • absExact

      public static long absExact(long a)
      As Math.absExact.
    • clamp

      public static int clamp(long a, int b, int c)
      As Math.clamp.
    • clamp

      public static long clamp(long a, long b, long c)
      As Math.clamp.
    • clamp

      public static double clamp(double a, double b, double c)
      As Math.clamp.
    • clamp

      public static float clamp(float a, float b, float c)
      As Math.clamp.