The Java Math Library provides various Functions and Constants / Properties, which allows us to perform basic mathematical functionality such as the elementary exponential, square root, cube root, logarithmic and trigonometric functions. Unlike other global objects, Properties and Functions inside the math class are static so, we can access the properties as ** Math.PI** and functions as

*.*

**Math.abs(number)**## Java Math Library Properties

The following table will show you the list of Properties or Constants available in Java Math library

Modifier Type | Java Math Properties | Description |
---|---|---|

static double | Math.E | It will return the Euler’s Number E, which is approximately equal to 2.71828 |

static double | Math.PI | It will return the Pie Value, which is approximately equal to 3.14 |

## Java Math Library Functions

The following table will show you the list of Functions available in Java Math Library

Modifier Type | Java Math Functions | Description |
---|---|---|

static double | abs(double x) | It will return the Absolute value of a Double value |

static float | abs(float x) | It will return the Absolute value of a Float value |

static int | abs(int x) | It will return the Absolute value of an Integer |

static long | abs(long x) | It will return the Absolute value of a Long value |

static double | cbrt(double x) | It is used to return the Cube root of the specified expression or a double value. |

static double | ceil(double x) | It is used to return the smallest double value which is greater than or equal to the specified expression or a double value. |

static double | copySign(double magnitude, double sign) | It is used to find the Absolute value of first argument along with sign specified in second argument |

static float | copySign(float magnitude, float sign) | It is used to find the Absolute value of first argument along with sign specified in second argument |

static double | floor(double x) | It is used to return the largest integer value which is less than or equal to the specified expression or a double value. |

static double | getExponent(double x) | It returns the unbiased exponent used in the representation of double. |

static float | getExponent(float x) | It returns the unbiased exponent used in the representation of float. |

static double | IEEEremainder(double x, double y) | It will calculate the remainder of two arguments as prescribed by the IEEE 754 standards and returns value. |

static double | max(double x, double y) | It is used to return the Largest of two double values. |

static float | max(float x, float y) | It is used to return the Largest of two float values. |

static int | max(int x, int y) | It is used to return the Largest of two int values. |

static long | max(long x, long y) | It is used to return the Largest of two long values. |

static double | min(double x, double y) | It is used to return the Smallest of two double values. |

static float | min(float x, float y) | It is used to return the Smallest of two float values. |

static int | min(int x, int y) | It is used to return the Smallest of two int values. |

static long | min(long x, long y) | It is used to return the Smallest of two long values. |

static double | nextAfter(double start, double direction) | It returns floating point value that is adjacent to the first argument in the direction of second argument. |

static float | nextAfter(float start, double direction) | It returns floating point value that is adjacent to the first argument in the direction of second argument. |

static double | nextUp(double x) | It returns the adjacent value of given argument in the direction of positive infinity. |

static float | nextUp(float x) | It returns the adjacent value of given argument in the direction of positive infinity. |

static double | pow(double x, double y) | It is used to return the value of first argument raised to the Power of the second argument |

static double | random() | It is used to return double value with positive sign and the value will be greater than or equal to 0.0 and less than 1.0 |

static double | rint(double x) | It is used to return the double value which is closest to the given argument and equal to mathematical integer |

static long | round(double x) | It is used to round the specified expression or an individual number to nearest long. |

static int | round(double x) | It is used to round the specified expression or an individual number to nearest int. |

static double | scalb(double x, int ScaleFactor) | It is used to return x * 2^{ScaleFactor} rounded as if performed by a single correctly rounded floating-point multiply to a member of the double value set. |

static float | scalb(float x, int ScaleFactor) | It is used to return x * 2^{ScaleFactor} rounded as if performed by a single correctly rounded floating-point multiply to a member of the float value set. |

static double | signum(double x) | It is used to return the signum of the given argument. |

static float | signum(float x) | It is used to return the signum of the given argument. |

static double | sqrt(double x) | It is used to find the square root of a specified expression or an individual number |

static double | ulp(double x) | It is used to return the size of a ulp of the given double argument |

static float | ulp(float x) | It is used to return the size of a ulp of the given float argument |

### Java Math Logarithmic Functions

Following functions are the list of Power and logarithmic functions available in Java Math Library.

Modifier Type | Power and Logarithmic Functions | Description |
---|---|---|

static double | exp(double x) | It is used to return E raised to the power of double value, Where E is Euler’s number and it is approximately equal to 2.71828. |

static double | expm1(double x) | It is used to calculate the power of E (Where E is Euler’s number approximately equal to 2.71828) and subtracts one from it. |

static double | log(double x) | It is used to calculate the logarithmic value of given number with base E. |

static double | log10(double x) | It is used to calculate the logarithmic value of given number with base 10. |

static double | log1p(double x) | It returns the natural algorithm of the sum of the arguments and 1. |

### Java Math Trigonometric Functions

Following functions are the list of Trigonometric functions available in Java Math Library.

Modifier Type | Trigonometric Functions | Description |
---|---|---|

static double | acos (double x) | It will return the trigonometric Arc Cosine value of a Given double value |

static double | asin(double x) | It will return the trigonometric Arc Sine value of a Given double value |

static double | atan(double x) | It will return the trigonometric Arc Tangent value of a Given double value |

static double | atan2(double y, double x) | It will return the angle (in radius) from the X-Axis to the specified point (y, x). |

static double | cos(double x) | It will return the trigonometric Cosine value of a Given double value |

static double | hypot(double x, double y) | It will return the sqrt(x² + y²) without intermediate overflow or underflow |

static double | sin(double x) | It will return the trigonometric Sine value of a Given double value |

static double | tan(double x) | It will return the trigonometric Tangent value of a Given double value |

### Java Math Hyperbolic Functions

The Hyperbolic Functions are trigonometric functions which allows us to perform following functions on Hyperbolic, instead of Circles. Following functions are the list of Hyperbolic functions available in Java Math Library.

Modifier Type | Hybrbolic Functions | Description |
---|---|---|

static double | cosh(double x) | It will return the trigonometric Hyperbolic Cosine value of a Given double value |

static double | sinh(double x) | It will return the trigonometric Hyperbolic Sine value of a Given double value |

static double | tanh(double x) | It will return the trigonometric Hyperbolic Tangent value of a Given double value |

### Java Math Angular Functions

Following functions are the list of Angular functions available in Java Math Library.

Modifier Type | Java Angular Functions | Description |
---|---|---|

static double | toDegrees(double x) | It will convert the specified Radians angle to equivalent angle measured in Degrees. |

static double | toRadians(double x) | It will convert the specified Degrees angle to equivalent angle measured in Radians. |

Thank You For Visiting Our Blog