Mathematical functions in Java

Source: Internet
Author: User
Mathematical functions in Java

To call mathematical functions in Java, you must use import java. Lang. Math .*
;

Ceil (double)
Returns a double value not less than the minimum integer (closest to negative infinity) of this parameter.
Floor (double)
Returns a double value not greater than the maximum integer (closest to positive infinity) of this parameter.
Ieeeremainder (double, double)
Calculate the remainder operation of the two parameters according to the IEEE 754 standard.
Pow (double, double)
Returns the second of parameter 1.
Random ()
Returns 0.0 to 1.0
Random Number.
RINT (double)
Returns the nearest integer to this parameter.
Double todegrees (double angrad)
         
Converts an angle measured in radians to an approximately
Equivalent angle measured in
Degrees.
 Double toradians (double
Angdeg)
         
Converts an angle measured in degrees to an approximately
Equivalent angle measured in radians.

Math category

  Math
Category includes some numeric calculation methods. Such as exponent, logarithm, square, trigonometric function, etc.

Math data domains:

         
Double E = 1, 2.7182818284590452354

         
Double Pi = ETA

Math category Method

         
ABS (Double X): returns the absolute value of X. X can also be int long float.

         
ACOs (Double X): returns the arc cosine of X.

         
Asin (Double X): returns the arcsin function value of X.

         
Atan (Double X): returns the arc tangent function value of X.

         
Atan2 (Double X, Double Y): returns the θ value of polar.

         
Ceil (Double X): returns a minimum integer not less than X.

         
Cos (Double X): returns the cosine of X's diameter.

         
Exp (Double X): returns an ex value.

         
Floor (Double X): returns the largest integer not greater than X.

         
Log (Double X): returns the natural logarithm function value of X.

         
Max (Double X, Double Y): returns a large number of X and Y.

         
Min (Double X, Double Y): returns X and Y decimal places.

         
Pow (Double X, Double Y): returns the XY value.

         
Random (): returns a random number.

         
RINT (Double X): returns an integer closest to X.

         
Round (Double X): returns the rounded value of X.

         
Sin (Double X): returns the sine function value of X's diameter.

         
SQRT (Double X): returns x square value

         
Tan (Double X): returns the tangent function value of X diameter.

         
Todegrees (double angrad): returns the angrad diameter to the angle

         
Toradians (double angdeg): returns the angdeg angle to the diameter

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.