Parameters: a - a value Returns: the base 10 logarithm of a. If the argument is positive zero or negative zero, then the result is the same as the argument. Otherwise, the result is the double value closest to the true mathematical square root of the argument value. Parameters: a - a value. Returns: the positive square root of a.
If the argument is NaN or less than zero, the result is NaN. If the argument is infinite, then the result is an infinity with the same sign as the argument.
Returns: the cube root of a. If the remainder is zero, its sign is the same as the sign of the first argument. Special cases: If either argument is NaN, or the first argument is infinite, or the second argument is positive zero or negative zero, then the result is NaN. If the first argument is finite and the second argument is infinite, then the result is the same as the first argument.
Parameters: f1 - the dividend. Returns: the remainder when f1 is divided by f2. Special cases: If the argument value is already equal to a mathematical integer, then the result is the same as the argument. If the argument is NaN or an infinity or positive zero or negative zero, then the result is the same as the argument.
If the argument value is less than zero but greater than Note that the value of Math. Returns: the smallest closest to negative infinity floating-point value that is greater than or equal to the argument and is equal to a mathematical integer. Returns: the largest closest to positive infinity floating-point value that less than or equal to the argument and is equal to a mathematical integer.
If two double values that are mathematical integers are equally close, the result is the integer value that is even. Parameters: a - a double value.
Returns: the closest floating-point value to a that is equal to a mathematical integer. If the first argument is positive zero and the second argument is positive, or the first argument is positive and finite and the second argument is positive infinity, then the result is positive zero.
If the first argument is negative zero and the second argument is positive, or the first argument is negative and finite and the second argument is positive infinity, then the result is negative zero. If the first argument is positive zero and the second argument is negative, or the first argument is positive and finite and the second argument is negative infinity, then the result is the double value closest to pi.
If the first argument is negative zero and the second argument is negative, or the first argument is negative and finite and the second argument is negative infinity, then the result is the double value closest to - pi.
The computed result must be within 2 ulps of the exact result. 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.
Special cases: If the second argument is positive or negative zero, then the result is 1. If the second argument is 1. If the second argument is NaN, then the result is NaN. If the first argument is NaN and the second argument is nonzero, then the result is NaN.
If the absolute value of the first argument is greater than 1 and the second argument is positive infinity, or the absolute value of the first argument is less than 1 and the second argument is negative infinity, then the result is positive infinity. If the absolute value of the first argument is greater than 1 and the second argument is negative infinity, or the absolute value of the first argument is less than 1 and the second argument is positive infinity, then the result is positive zero.
If the absolute value of the first argument equals 1 and the second argument is infinite, then the result is NaN. If the first argument is positive zero and the second argument is greater than zero, or the first argument is positive infinity and the second argument is less than zero, then the result is positive zero. If the first argument is positive zero and the second argument is less than zero, or the first argument is positive infinity and the second argument is greater than zero, then the result is positive infinity.
If the first argument is negative zero and the second argument is greater than zero but not a finite odd integer, or the first argument is negative infinity and the second argument is less than zero but not a finite odd integer, then the result is positive zero. If the first argument is negative zero and the second argument is a positive finite odd integer, or the first argument is negative infinity and the second argument is a negative finite odd integer, then the result is negative zero.
If the first argument is negative zero and the second argument is less than zero but not a finite odd integer, or the first argument is negative infinity and the second argument is greater than zero but not a finite odd integer, then the result is positive infinity.
If the first argument is negative zero and the second argument is a negative finite odd integer, or the first argument is negative infinity and the second argument is a positive finite odd integer, then the result is negative infinity. If the first argument is finite and less than zero if the second argument is a finite even integer, the result is equal to the result of raising the absolute value of the first argument to the power of the second argument if the second argument is a finite odd integer, the result is equal to the negative of the result of raising the absolute value of the first argument to the power of the second argument if the second argument is finite and not an integer, then the result is NaN.
If both arguments are integers, then the result is exactly equal to the mathematical result of raising the first argument to the power of the second argument if that result can in fact be represented exactly as a double value. In the foregoing descriptions, a floating-point value is considered to be an integer if and only if it is finite and a fixed point of the method ceil or, equivalently, a fixed point of the method floor.
A value is a fixed point of a one-argument method if and only if the result of applying the method to the value is equal to the value. Parameters: a - the base. Returns: the value a b. Special cases: If the argument is NaN, the result is 0. If the argument is negative infinity or any value less than or equal to the value of Integer. If the argument is positive infinity or any value greater than or equal to the value of Integer.
Parameters: a - a floating-point value to be rounded to an integer. Returns: the value of the argument rounded to the nearest int value. See Also: Integer. If the argument is negative infinity or any value less than or equal to the value of Long.
If the argument is positive infinity or any value greater than or equal to the value of Long. Parameters: a - a floating-point value to be rounded to a long. Returns: the value of the argument rounded to the nearest long value. See Also: Long. Returned values are chosen pseudorandomly with approximately uniform distribution from that range. When this method is first called, it creates a single new pseudorandom-number generator, exactly as if by the expression new java. Random This new pseudorandom-number generator is used thereafter for all calls to this method and is used nowhere else.
This method is properly synchronized to allow correct use by more than one thread. However, if many threads need to generate pseudorandom numbers at a great rate, it may reduce contention for each thread to have its own pseudorandom-number generator. Returns: a pseudorandom double greater than or equal to 0. See Also: Random. If the argument is not negative, the argument is returned. If the argument is negative, the negation of the argument is returned.
Note that if the argument is equal to the value of Integer. Parameters: a - the argument whose absolute value is to be determined Returns: the absolute value of the argument.
Note that if the argument is equal to the value of Long. Special cases: If the argument is positive zero or negative zero, the result is positive zero. If the argument is infinite, the result is positive infinity. If the argument is NaN, the result is NaN.
In other words, the result is the same as the value of the expression: Float. In other words, the result is the same as the value of the expression: Double. That is, the result is the argument closer to the value of Integer. If the arguments have the same value, the result is that same value. Parameters: a - an argument. Returns: the larger of a and b. That is, the result is the argument closer to the value of Long. That is, the result is the argument closer to positive infinity. If either value is NaN, then the result is NaN.
Unlike the numerical comparison operators, this method considers negative zero to be strictly smaller than positive zero. If one argument is positive zero and the other negative zero, the result is positive zero.
Print Pyramids and Patterns. Multiply two matrices. Find the standard deviation. Reference Materials String. Start Learning Java. Explore Java Examples. Java Math Methods Java Math. Related Topics Java Math floor. Java Math round In this tutorial, we will learn about the Java Math. Previous Tutorial:. Next Tutorial:. Please mail your requirement at [email protected] Duration: 1 week to 2 week.
Java Training Java Tutorial. Abstract class Interface Abstract vs Interface. Package Access Modifiers Encapsulation. This method returns the value of the argument rounded to the nearest int value. Next Topic Java Math. Reinforcement Learning.
R Programming. React Native. Python Design Patterns. Python Pillow. Python Turtle. Verbal Ability. Interview Questions.
0コメント