JAVA Math Package

Source: Internet
Author: User

Math class:

Java.lang.Math

The class contains basic numeric operations such as exponential, logarithmic, square root, and trigonometric functions.

Java.math is a package that provides classes for executing arbitrary precision Integer (BigInteger) algorithms and arbitrary Precision Decimal (BigDecimal) algorithms.

Java.lang.Math

The class contains two static constants for E and Pi, and a class (static) method for scientific calculation, which can be called directly from the class name.

public static final Double E = 2.7182818284590452354

public static final Double PI = 3.14159265358979323846

public static long ABS (Double x): Returns the absolute value of x. X can also be int long float

public static long sin (double x): Returns the value of the sine function of the X-diameter

public static long cos (double x): Returns the cosine function value of x-diameter

public static Long Tan (double x): Returns the value of the tangent function of the X-diameter

public static long Asin (double X): Returns the value of the inverse chord function of the X value.

public static long ACOs (double x): Returns the value of the inverse cosine function of the X value.

public static Long Atan (double x): Returns the inverse tangent function value of the X value.

public static long atan2 (double x, double y): Theta value for return polar coordinates (polar)

public static long floor (double x): Returns the maximum integer value not greater than X

public static long Ceil (double x): Returns the smallest integer value not less than X.

public static long exp (double x): Returns equivalent to E^x value

public static long log (double X): Returns the natural logarithm function value of x

public static long Max (double x,double y): Returns the larger number of X and Y

public static long min (double x,double y): Returns the x, y smaller number

public static long Pow (double x,double y)

: Returns the Y power value of X

public static long sqrt (double x): Returns x Open square value

public static long Rint (double x): Returns the integer value closest to X

public static long round (double x): Returns the rounded value of X

public static long Todegrees (double Angrad): Returns the Angrad diameter into an angle

public static long Toradians (double angdeg): Returns the angdeg angle into a diameter

public static Long Random (): Returns random numbers, generating a random number between 0-1 (excluding 0 and 1)

Math.log (+)/math.log (10); Represents 100 of the value of the 10 base logarithmic function, which is 2

Rounding up with Math.ceil (double A)

Rounding down with Math.floor (double A)

JAVA Math Package

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.