Any expressions can be operated through certain method calls. There are some functions have been used in the given example. All the functions have been explained below with example :
E
This is E field of the Math class which returns you a default exponent value that is closer than any other to e, the base of the natural logarithms.
PI
This is also a field of the Method class which returns you a default pi value, the ratio of the circumference of a circle to its diameter.
abs()
This is the abs() function which returns you the absolute number.
ceil()
This is the ceil() function which returns you the smallest value but greater than the argument.
exp()
This is the exp() function which returns you the exponential value raised to the power of a double value.
floor()
This is the floor() function which returns you the largest value but less than the argument.
IEEEremainder()
This is the IEEEremainder() which returns you the remainder for the given dividend and divisor.
max()
This is the max() function which distinguishes the maximum value from the two given value.
min()
This is the min() function which distinguishes the minimum value from the two given value.
pow()
This is the pow() function which returns you the number raised to the power of a first given value by the another one.
random()
This is the random() function which returns you the random number. It is absolutely system generated.
rint()
This is the rint() function which returns you a value closest to the given value.
round()
This is the round() function which returns you a value that is in the rounded form.
sqrt()
This is the sqrt() function which returns you the square root of the specified value.
Code for the program :
public class mathclass{ the argument = " + Math.ceil(Math.PI)); the argument = " + Math.exp(0)); than the argument = " + Math.floor(Math.E)); Math.IEEEremainder(5.3f,2.2f)); Math.max(10,10.3)); Math.min(10,10.3)); Math.random()); = " + Math.rint(30)); |
No comments:
Post a Comment