java.lang.Math (javaSE-1.8)
Math.E :2.718281828459045 //returns number closer to another other natural logs
--------------------------------------------------------------
Math.PI :3.141592653589793
--------------------------------------------------------------
Math.addExact(3, -790) :-4 //adds arguments
Math.subtractExact(3,-7) :10 //subtracts arguments
Math.decrementExact(4) :3 //decrement argument by 1
Math.incrementExact(4) :5: //increments argument by 1
Math.multiplyExact(3,4) :12
Math.negateExact(3) :-3
--------------------------------------------------------------
Math.cbrt(8) :2.0
Math.sqrt(4) :2.0
Math.abs(-32.54536) :32.54536 //removes negation
Math.max(34, 34.2) :34.2
Math.min(34, 34.2) :34.0
Math.nextAfter(3, 5) :3.0000002 ://returns closed of the first towards teh second
Math.pow(2, 3) :8.0
Math.random() :0.9903858200332046
Math.round(3.569) :4
Math.rint(5.6) :6.0
--------------------------------------------------------------
Math.ceil(3.4) :4.0
Math.floor(3.4) :3.0
Math.floorDiv(4, 3) :1 //returns [Math.floor(4/3)].. applies to int /long
Math.floorMod(4, 3) :1 //returns [ 4 - (floorDiv(4,3) * 4) ]
--------------------------------------------------------------
Math.copySign(30.34, -89.1) :-30.34 //returns 1st argument with sign of 2nd
--------------------------------------------------------------
Math.exp(1) :2.718281828459045 //returns Eulers number(2.7182...Math.E) raised to power of argument
Math.expm1(1) :1.718281828459045 //returns (Math.exp(argument) -1).. so, above.. returns (2.718...-1)
--------------------------------------------------------------
Math.hypot(3, 4) :5.0 //returns [ sqroot (3^2 + 4^2) ]
--------------------------------------------------------------
Math.getExponent(3) :1
--------------------------------------------------------------
Math.log10(1) :0.0
Math.log(2) : Math.log(1) 0.6931471805599453:0.0
--------------------------------------------------------------
No comments:
Post a Comment