Class ReplacementForMath


  • class ReplacementForMath
    extends java.lang.Object
    Replacement methods for the class java.lang.Math.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      (package private) static double abs​(double x)
      Replacement for Math.abs(double)
      (package private) static float abs​(float x)
      Replacement for Math.abs(float)
      (package private) static double acos​(double x)
      Replacement for Math.acos(double)
      (package private) static double asin​(double x)
      Replacement for Math.asin(double)
      (package private) static double atan​(double x)
      Replacement for Math.atan(double)
      (package private) static double atan2​(double y, double x)
      Replacement for Math.atan2(double, double)
      (package private) static double cbrt​(double x)
      Replacement for Math.cbrt(double)
      (package private) static double ceil​(double x)
      Replacement for Math.ceil(double)
      (package private) static double copySign​(double a, double b)
      Replacement for Math.copySign(double,double)
      (package private) static float copySign​(float a, float b)
      Replacement for Math.copySign(float,float)
      (package private) static double cos​(double x)
      Replacement for Math.cos(double)
      (package private) static double cosh​(double x)
      Replacement for Math.cosh(double)
      (package private) static double exp​(double x)
      Replacement for Math.exp(double)
      (package private) static double expm1​(double a, double b)
      Replacement for Math.expm1(double)
      (package private) static double floor​(double x)
      Replacement for Math.floor(double)
      (package private) static double hypot​(double a, double b)
      Replacement for Math.hypot(double, double)
      (package private) static double IEEEremainder​(double f1, double f2)
      Replacement for Math.IEEEremainder(double,double)
      (package private) static double log​(double x)
      Replacement for Math.log(double)
      (package private) static double log10​(double x)
      Replacement for Math.log10(double)
      (package private) static double log1p​(double a, double b)
      Replacement for Math.log1p(double)
      (package private) static double max​(double a, double b)
      Replacement for Math.max(double,double)
      (package private) static float max​(float a, float b)
      Replacement for Math.max(float,float)
      (package private) static double min​(double a, double b)
      Replacement for Math.min(double,double)
      (package private) static float min​(float a, float b)
      Replacement for Math.min(float,float)
      (package private) static double pow​(double a, double b)
      Replacement for Math.pow(double, double)
      (package private) static double random()
      Replacement for Math.random()
      (package private) static double rint​(double x)
      Replacement for Math.rint(double)
      (package private) static double sin​(double x)
      Replacement for Math.sin(double)
      (package private) static double sinh​(double x)
      Replacement for Math.sinh(double)
      (package private) static double sqrt​(double x)
      Replacement for Math.sqrt(double)
      (package private) static double tan​(double x)
      Replacement for Math.tan(double)
      (package private) static double tanh​(double x)
      Replacement for Math.tanh(double)
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ReplacementForMath

        ReplacementForMath()
    • Method Detail

      • sin

        static double sin​(double x)
        Replacement for Math.sin(double)
        Parameters:
        x - an angle, in radians.
        Returns:
        the sine of the argument.
      • cos

        static double cos​(double x)
        Replacement for Math.cos(double)
        Parameters:
        x - an angle, in radians.
        Returns:
        the cosine of the argument.
      • tan

        static double tan​(double x)
        Replacement for Math.tan(double)
        Parameters:
        x - an angle, in radians.
        Returns:
        the tangent of the argument.
      • asin

        static double asin​(double x)
        Replacement for Math.asin(double)
        Parameters:
        x - the value.
        Returns:
        the arc sine of the argument.
      • acos

        static double acos​(double x)
        Replacement for Math.acos(double)
        Parameters:
        x - the value.
        Returns:
        the arc cosine of the argument.
      • atan

        static double atan​(double x)
        Replacement for Math.atan(double)
        Parameters:
        x - the value.
        Returns:
        the arc tangent of the argument.
      • exp

        static double exp​(double x)
        Replacement for Math.exp(double)
        Parameters:
        x - the value.
        Returns:
        the value ex
      • log

        static double log​(double x)
        Replacement for Math.log(double)
        Parameters:
        x - the value.
        Returns:
        the value ln x
      • log10

        static double log10​(double x)
        Replacement for Math.log10(double)
        Parameters:
        x - the value.
        Returns:
        the base 10 logarithm of x
      • sqrt

        static double sqrt​(double x)
        Replacement for Math.sqrt(double)
        Parameters:
        x - the value.
        Returns:
        the positive square root of x
      • cbrt

        static double cbrt​(double x)
        Replacement for Math.cbrt(double)
        Parameters:
        x - the value.
        Returns:
        the cube root of x
      • IEEEremainder

        static double IEEEremainder​(double f1,
                                    double f2)
        Replacement for Math.IEEEremainder(double,double)
        Parameters:
        f1 - the dividend.
        f2 - the divisor.
        Returns:
        the remainder when f1 is divided by f2.
      • ceil

        static double ceil​(double x)
        Replacement for Math.ceil(double)
        Parameters:
        x - the value.
        Returns:
        the smallest (closest to negative infinity) integer value
      • floor

        static double floor​(double x)
        Replacement for Math.floor(double)
        Parameters:
        x - the value.
        Returns:
        the largest (closest to positive infinity) integer value
      • rint

        static double rint​(double x)
        Replacement for Math.rint(double)
        Parameters:
        x - the value.
        Returns:
        the closest floating-point integer value
      • atan2

        static double atan2​(double y,
                            double x)
        Replacement for Math.atan2(double, double)
        Parameters:
        y - the ordinate coordinate
        x - the abscissa coordinate
        Returns:
        the theta component of the point(r, theta)in polar coordinates that corresponds to the point(x, y) in Cartesian coordinates.
      • pow

        static double pow​(double a,
                          double b)
        Replacement for Math.pow(double, double)
        Parameters:
        a - the base.
        b - the exponent.
        Returns:
        the value ab.
      • random

        static double random()
        Replacement for Math.random()
        Returns:
        a pseudorandom double greater than or equal 0.0 and less than 1.0.
      • abs

        static double abs​(double x)
        Replacement for Math.abs(double)
        Parameters:
        x - the value.
        Returns:
        the absolute value of the argument.
      • abs

        static float abs​(float x)
        Replacement for Math.abs(float)
        Parameters:
        x - the value.
        Returns:
        the absolute value of the argument.
      • max

        static double max​(double a,
                          double b)
        Replacement for Math.max(double,double)
        Parameters:
        a - an argument.
        b - another argument.
        Returns:
        the larger of a and b.
      • max

        static float max​(float a,
                         float b)
        Replacement for Math.max(float,float)
        Parameters:
        a - an argument.
        b - another argument.
        Returns:
        the larger of a and b.
      • min

        static double min​(double a,
                          double b)
        Replacement for Math.min(double,double)
        Parameters:
        a - an argument.
        b - another argument.
        Returns:
        the smaller of a and b.
      • min

        static float min​(float a,
                         float b)
        Replacement for Math.min(float,float)
        Parameters:
        a - an argument.
        b - another argument.
        Returns:
        the smaller of a and b.
      • sinh

        static double sinh​(double x)
        Replacement for Math.sinh(double)
        Parameters:
        x - The number whose hyperbolic sine is to be returned.
        Returns:
        The hyperbolic sine of the argument.
      • cosh

        static double cosh​(double x)
        Replacement for Math.cosh(double)
        Parameters:
        x - The number whose hyperbolic cosine is to be returned.
        Returns:
        The hyperbolic cosine of the argument.
      • tanh

        static double tanh​(double x)
        Replacement for Math.tanh(double)
        Parameters:
        x - The number whose hyperbolic tangent is to be returned.
        Returns:
        The hyperbolic tangent of the argument.
      • hypot

        static double hypot​(double a,
                            double b)
        Replacement for Math.hypot(double, double)
        Parameters:
        a - a value
        b - a value
        Returns:
        sqrt(a2+b2)
      • expm1

        static double expm1​(double a,
                            double b)
        Replacement for Math.expm1(double)
        Parameters:
        x - the exponent
        Returns:
        the value ex - 1.
      • log1p

        static double log1p​(double a,
                            double b)
        Replacement for Math.log1p(double)
        Parameters:
        x - a value
        Returns:
        the result
      • copySign

        static double copySign​(double a,
                               double b)
        Replacement for Math.copySign(double,double)
        Parameters:
        a - an argument.
        b - another argument.
        Returns:
        the result
      • copySign

        static float copySign​(float a,
                              float b)
        Replacement for Math.copySign(float,float)
        Parameters:
        a - an argument.
        b - another argument.
        Returns:
        the result