Professional Documents
Culture Documents
Page
Ma th
Math is aa class defined in java.lang package
and it pcovides various mathematcal functions.
nathabsC) Date
Poge
int long
arguments
oAbsCint Jint
|Oeseriptisn
lt take one
tloat, double labsllong ) torg argument
abs(float}tot)
abs Ldouble
and returng
doeeabsalute valuE
lgnares the
Siqn ândreturns
retag
the posiive
value
Eg.-ME’ l-5
J.E.’
Mathalos
2y int max intgint)
Long max (long,Lon) arguments and
loat |m-x Lloak ,float) returns the
double
maxldoubk,doubemaximum
|value.
Eg-Math.maxln,t5)
Ofp n.0
-Math.maxl-l4,-5)
o/h -13
Sangamo
Date
Page
Sqrt (dauble)
It takes one double arqument And returns
Square root ot a number.
Eq - Math sart l25)
olp 35.0
Math. sat-16)
3 Runtime Error
Date
Page
double cortldouble)
lt takes double_áraument and returns cube
root of a numher.
Ea - MAth.cbrt Cob4)
- Math. cbrt (-8)
olp -2.0
- Math.ceilC-16.8)
:-15.0
olp
Y double floor Cdouble)
Page
powdeukhle , double)
t takes two double arquments and returns first
arqument etn raised to the power of the
second arqument.
Eg- Math.pow (Msth.maxlrn,4), Math.min (I,3))
- Math. pow(64,o.5)
9.0
-Math.pow L64,) Nath-pow&4,0)
9)dauble -rintldloublk)
Page
found fdouble>
1o) int YOundlloat)
long round (double)
H takes one
arqument and rounds off the
Value. Till one decimal place..
Eq-
Math.round(.5) - Math. round(-1s.3)
28
- Math. round (8.44) - Math. ound (-o.5)
O/p &
Math.pow
Sangam (Laty),2)la)
Date
Page
double.
tong Log Ldouble)
This funcbon retunns the natural tetre
laqucithmic value.
Eg- Math.log (1o)
a double randomnC)
Page
JangaU