SCJP Tips: java.lang.math

xiaoxiao2021-03-06  52

CEIL (Double) returns a minimum integer value of the minimum integer (closest and infinite) of this parameter. Floor (double) returns the maximum integer value of this parameter (closest to an endless) Double value. IEEEREMAINDER (double, double) calculates two parameters in accordance with IEEE 754. Pow (double, double) returns the parameter of the parameter secondary party. Random () returns random number of 0.0 to 1.0. RINT (double) returns an integer closest 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

The MATH category includes some digital operations. Such as index, logarithm, open square, triangle function, etc.

Math Category Information Bar:

L Double E = 2.7182818284590452354

l Double pi = η

Math category

l ABS (Double X): The absolute value of the X is transmitted. X can also int long float

l ACOS (Double X): Removes the anti-hive function value of the x value.

l asin (double x): Removes the negative string function value of the x value.

l atan: The negative cut function value of the X value is transmitted.

l Atan2 (double x, double y): θ value of the polar seating (POLAR)

l C CEIL (Double X): The minimum integer value of not less than X is returned.

l COS (Double X): Removes the cosine function value of the X-axis

l Exp (Double X): Back to EX Value

l Flor (double x): The maximum integer value that is not more than X

l log (double x): By the natural logarithmic function value of X

l Max (Double X, Double Y): Back to X, Y, Large

L min (double x, double y): Remove x, y

l POW (double x, double y): Remove XY value

l random (): Back to the value

l RINT (Double X): Retrieves the integer value closest to X

l Round (Double X): Removing X of the Self-Raising Value

l sin (double x): Strove of the X-axis

l SQRT (double x): Remove X-open square value

l TAN (double x): The correct function value of the transmitted X

l TODEGREES (Double Angrad): Replies to the angle of the AngraD stage

l ToraDians (double angely): Reploys the angle of ang de as ziggeles

Field Summarystatic doubleE The double value that is closer than any other to e, the base of the natural logarithms.static doublePI The double value that is closer than any other to pi, the ratio of the circumference of a circle to its diameter.Method Summarystatic doubleabs (double a) Returns the absolute value of a double value.static floatabs (float a) Returns the absolute value of a float value.static intabs (int a) Returns the absolute value of an int value.static longabs (long a) Returns the absolute value of a long value.static doubleacos (double a) Returns the arc cosine of an angle, in the range of 0.0 through pi.static doubleasin (double a) Returns the arc sine of an angle, in the range of - PI / 2 THROUGH PI / 2.Static Doubletan (Double A) Returns The Arc Tangent of an Angle, In The Range of -pi / 2 THROUGH PI / 2.Static Doubletan2 (Double Y, Double X) Converts Rectangular Coordinates (X, Y) to polar (r, theta) .static doubleceil (double a) Returns the smallest (closest to negative infinity) double value that is not less than the argument and is equal to a mathematical integer.static doublecos (double a) Returns the trigonometric cosine OF An Angle.Static Doubleexp (Double A) Returns Euler '

s number e raised to the power of a double value.static doublefloor (double a) Returns the largest (closest to positive infinity) double value that is not greater than the argument and is equal to a mathematical integer.static doubleIEEEremainder (double f1, double f2) Computes the remainder operation on two arguments as prescribed by the IEEE 754 standard.static doublelog (double a) Returns the natural logarithm (base e) of a double value.static doublemax (double a, double b) Returns the greater of Two Double Values.Static Floatmax (Float A, Float B) Returns The Greater of Two Float Values.Static Intmax (Int A, INT B) Returns The Greater of Two int values.Static Longmax (Long a, long b) returns the greiver Of Two Long Values.Static Doublemin (Double A, Double B) Returns The Smaller of Two Double Values.Static Floatmin (Float A, Float B) Returns The Smaller of Two Float Values.Static Intmin (Int A, Int b) Returns the smaller of two int values.static longmin (long a, long b) Returns the smaller of two long values.static doublepow (double a, double b) Returns the value of the first argument raised to the power of the second argument. static doublerandom () Returns a double value with a positive sign, greater than or equal to 0.0 and less than 1.0.static doublerint (double a) Returns the double value that is closest in value to the argument and is equal to a mathematical integer. Static Longround (Double a) Returns The Closest Long To the Argument.Static Intround (Float A) Returns The Closest Int To The Argument.

static doublesin (double a) Returns the trigonometric sine of an angle.static doublesqrt (double a) Returns the correctly rounded positive square root of a double value.static doubletan (double a) Returns the trigonometric tangent of an angle.static doubletoDegrees (double angrad) Converts an angle measured in radians to an approximately equivalent angle measured in degrees.static doubletoRadians (double angdeg) Converts an angle measured in degrees to an approximately equivalent angle measured in radians. class java.lang.Mathjava.lang.Object

|

---- java.lang.math

Public Final Class

Math

Extends Object

Class MATH contains basic mathematical operations such as indices, logarithms, square roots, and triangular functions.

To ensure portability of the Java program, the definition of math functions in this package must be consistent with certain disclosed algorithm results. These algorithms can be obtained from the package "Freely Distributable Math Library" in Netlib in Netlib in the famous web library. These algorithms written in C language execute all floating point operations in accordance with Java floating point calculation rules.

This network library can be found in the following site of World Wide Web

http://neetlib.att.com/

Then perform keyword search target "fdlibm".

The version of the Java Mathematics library is FDLIBM Dated January 4, 1995. FDLIBM gives a variety of definitions (such as ACOS), using the IEEE 754 Core Function version (in a file starting with letter E).

Variable index

E

Should

Double value is very close

e, the base of natural logarithm.

Pi

Should

Double value is very close

PI, the perimeter of the circle and the ratio of the diameter.

Method index

ABS (Double)

Returns the absolute value of the Double value.

ABS (Float)

Returns the absolute value of the FLOAT value.

ABS (int)

Returns the absolute value of the INT value.

ABS (long)

Returns the absolute value of the LONG type.

ACOS (Double)

Returns the anti-cosine value of a corner, range 0.0 to Pi.

Asin (double)

Returns an angle of an angle, range -pi / 2 to pi / 2.

Atan (double)

Returns an interferon cut value, range -pi / 2 to pi / 2.

Atan2 (Double, Double)

Convert right angle coordinates (B, A) into pole coordinates (R, THETA).

CEIL (Double)

Returns the minimum integer (closest negative infinity) Double value of this parameter.

COS (double)

Returns a cosine of a corner.

Exp (double)

Returns the Double of E (ie, 2.718 ...).

Floor (double)

Returns the maximum integer (the closest and infinite) Double value of this parameter.

IEeeeMainder (double, double)

Calculate two parameters in accordance with IEEE 754 standard specified by the IEEE 754 standard.

Log (double)

Returns the natural logarithm of the Double value. Max (Double, Double)

Returns a larger one in two Double type values.

Max (Float, Float)

Returns one of the two Float types.

Max (int, int)

Returns one of the two INT types.

Max (long, long)

Returns a larger one in two long-type values.

MIN (Double, Double)

Returns a smaller one in two Double value.

MIN (Float, Float)

Returns a smaller one in two Float types.

MIN (int, int)

Returns a smaller in the two INT values.

MIN (long, long)

Returns a smaller one of the two LONG types.

Pow (Double, Double)

Returns the parameters of the parameters secondary party.

Random ()

Returns the random number of 0.0 to 1.0.

RINT (DOUBLE)

Returns an integer closest to this parameter.

Round (double)

Returns the LONG model closest to this parameter.

Round (float)

Returns the INT type that is closest to this parameter.

Sin (double)

Returns the sinusoidal of a corner.

SQRT (double)

Returns the square root of the Double value.

Tan (double)

Returns the orthosis of a corner.

variable

E

Public Static Final Double E

Should

Double value is very close to

e, the base of natural logarithm.

Pi

Public Static Final Double Pi

Should

Double value is very close

PI, the perimeter of the circle and the ratio of the diameter.

method

Sin

Public Static Native Double Sin (Double A)

Returns a sine value of a corner.

parameter:

A - an angle calculated by radians.

return value:

The sine value of the parameters.

COS

Public Static Native Double Cos (Double A)

Returns a cosine value of a corner.

parameter:

A - an angle calculated by radians.

return value:

The cosine value of the parameters.

Tan

Public Static Native Double Tan (Double A)

Returns the positive cut value of a corner.

parameter:

A - an angle calculated by radians.

return value:

The positive cut value of the parameters.

asin

Public Static Native Double Asin (Double A)

Returns an angle of an angle, range -

PI / 2 to

Pi / 2.

parameter:

A - an angle calculated by radians.

return value:

The anti-hout value of the parameters.

ACOS

Public Static Native Double ACOS (Double A)

Returns a sinus value of a corner, range 0.0 to

Pi.

parameter:

A - an angle calculated by radians.

return value:

The anti-hout value of the parameters.

Atan

Public Static Native Double Atan (Double A)

Returns an angle cut value, range -

PI / 2 to

Pi / 2.

parameter:

A - an angle calculated by radians.

return value:

The anvective value of the parameters.

EXP

Public Static Native Double Exp (Double A)

return

E (ie, 2.718 ...) A movie,

Double value.

parameter:

A - one

Double value.

return value:

e

a, here

E is the base of natural logarithm.

log

Public Static Native Double log (double a)

Returns a (in

E is the bottom)

Double type natural logarithm.

parameter:

a - bigger than

The number of 0.0.

return value:

ln

a,

A natural logar of A.

SQRT

Public Static Native Double SQRT (Double A)

Returns a square root of A,

Double value.

parameter:

A - one

Double value.

return value:

a square root of a. If the parameter is NaN or less than zero, the result is nan.

IEeeeMainder

Public Static Native Double IEeeeMainDer (Double F1,

Double F2)

Calculate two parameters in accordance with IEEE 754 standard specified by the IEEE 754 standard. The remainder is equal to

F1 - F2 ×

n, here

N is the closest business

The integer of F1 / F2, and if there are two equations close to

F1 / f2, then

One of the N-tap. If the remainder is zero, its symbol is the same as the first parameter.

parameter:

F1 - divided.

F2 - divisor.

return value:

F1

The remainder of F2.

CEIL

Public Static Native Double CEIL (Double A)

Returns the minimum integer (closest and infinite) that is not less than this parameter

Double value.

parameter:

A - one

Double value.

return value:

Returns the minimum integer (closest and infinite) that is not less than this parameter

Double value.

Floor

Public Static Native Double Flor (Double A)

Returns the maximum integer (the closest and infinite) of this parameter (closest)

Double value.

parameter:

A - one

Double value.

a - specified value.

return value:

Returns the maximum integer (the closest and infinite) of this parameter (closest)

Double value.

Rint

Public Static Native Double Rint (Double A)

Returns an integer closest to this parameter.

parameter:

A - one

Double value.

return value:

Closest

A integer

Double value. If two

The Double value is also close to this parameter, and the return value is an even number.

Atan2

Public Static Native Double Atan2 (Double A,

Double B)

Cut the right angle coordinate (

b,

a) Convert to pole coordinates (R,

Theta). This method calculates

Anti-rotation of B / A

Theta, range -

PI

Pi.

parameter:

A - one

Double value.

B - one

Double value.

return value:

Polar coordinate

R,

The Theta

The Theta part corresponds to the point in the Cartesian coordinates (

b,

a).

Pow

Public Static Native Double Pow (Double A,

Double B)

Returns the power value of the index of the index with the number of parameters.

If (a == 0.0), then B must be greater than 0.0; otherwise an exception will be thrown. If (a <= 0.0) and B is an integer, an exception occurs.

parameter:

A - one

Double value.

B - one

Double value.

return value:

AB.

Throw: ArithmeticException

in case (

A == 0.0) and (

B <= 0.0), or if (

a <= 0.0)

B is not integer.

Round

Public Static Int Round (Float A)

Return to this parameter closest

INT type.

If the parameter is an negative or value of the value or equal to INTEGER.MIN_VALUE, the result is equal to INTEGER.MIN_VALUE.

If the parameter is an infinity or value greater than or equal to Integer.max_Value, the result is equal to INTEGER.MAX_VALUE. parameter:

A - one

Float value.

return value:

This parameter is rounded to the nearest

INT value.

See:

MAX_VALUE, Min_Value

Round

Public Static Long Round (Double A)

Return to this parameter closest

Long type.

If this parameter is an negative or value of the value or equal to long.min_Value, the result is equal to long.min_value.

If the parameter is a negative or value of the value or less than or equal to long.max_value, the result is equal to Long.max_Value.

parameter:

A - one

Double value.

return value:

This parameter is rounded to the nearest

LONG type value.

See:

MAX_VALUE, Min_Value

random

Public Static Synchronized Double Random ()

return

0.0 to

Random number of 1.0. The so-called random number generator is typically a pseudo-random number generator because it generates a periodic loop.

return value:

return

0.0 to

1.0 pseudo random numbers.

See:

Nextdouble

ABS

Public Static Int ABS (INT A)

Returned A

INT type absolute value. If the parameters are not negated, the parameter is returned. If the parameter is negative, return it to its opposite.

Note that if the parameter is equal to INTEGER.MIN_VALUE, the minimum negative INT value can be represented, the result is equal to the equal and negative.

parameter:

A - one

INT value.

return value:

The absolute value of the parameters.

See:

Min_value

ABS

Public Static Long ABS (Long A)

Returned A

LONG type absolute value. If the parameters are not negated, the parameter is returned. If the parameter is negative, return it to its opposite.

Note that if the parameter is equal to Long.min_Value, the minimum negative LONG type value can be represented, the result is equal to the equal and negative.

parameter:

A - one

LONG type value.

return value:

The absolute value of the parameters.

See:

Min_value

ABS

Public Static float abs (float a)

Returned A

The absolute value of the Float type. If the parameters are not negated, the parameter is returned. If the parameter is negative, return it to its opposite.

parameter:

A - one

Float value.

return value:

The absolute value of the parameters.

ABS

Public Static Double ABS (Double A)

Returned A

Double type absolute value. If the parameters are not negated, the parameter is returned. If the parameter is negative, return it to its opposite.

parameter:

A - one

Double value.

return value:

The absolute value of the parameters.

Max

Public Static Int Max (Int A,

INT B)

Returning two

A larger INT value.

parameter:

A - one

INT value.

B - one

INT value.

return value:

a and

The bigger of B.

Max

Public Static Long Max (Long A,

Long b)

Returning two

One of the LONG type.

parameter:

A - one

LONG type value.

A - one

LONG type value.

return value:

a and

The bigger of B.

Max

Public Static Float Max (Float A,

Float b)

Returning two

A larger in the Float value. As long as one is

Nan, the result is

Nan. This method believes that the negative zero is less than normal.

parameter:

A - one

Float value.

B - one

Float value.

return value:

a and

The bigger of B.

Max

Public Static Double Max (Double A,

Double B)

Returning two

One of the Double value. As long as one is

Nan, the result is

Nan. This method believes that the negative zero is less than normal.

parameter:

A - one

Double value.

B - one

Double value.

return value:

a and

The bigger of B.

MIN

Public Static Int min (Int A,

INT B)

Returning two

A smaller INT value.

parameter:

A - one

INT value.

B - one

INT value.

return value:

a and

The smaller in b.

MIN

Public Static Long Min (Long A,

Long b)

Returning two

One of the smallest value of the LONG type.

parameter:

A - one

LONG type value.

A - one

LONG type value.

return value:

a and

The smaller in b.

MIN

Public static float min (float a,

Float b)

Returning two

A smaller in the Float value. As long as one is

Nan, the result is

Nan. This method believes that the negative zero is less than normal.

parameter:

A - one

Float value.

B - one

Float value.

return value:

a and

The smaller in b.

MIN

Public Static Double Min (Double A,

Double B)

Returning two

One of the smallest value of the DOUBLE value. As long as one is

Nan, the result is

Nan. This method believes that the negative zero is less than normal.

parameter:

A - one

Double value.

B - one

Double value.

return value:

a and

The smaller in b.

IEeeeMainder Todegrees Toradians has uppercase letters

转载请注明原文地址:https://www.9cbs.com/read-118294.html

New Post(0)