JavaScript mathematical functions
(methods of the Math object):
නිරපේක්ෂ සංඛ්යා
Math.abs(a) // the absolute value of a
Math.abs(-5.2)=> 5.2
Math.sqrt(a) // square root of a වර්ග මූලය
Math.sqrt(4)=> 2
Math.max(a,b) // the maximum of a and b
Math.min(a,b) // the minimum of a and b
Math.max(5,6)=> 6
Math.min(5,6)=> 5
Math.pow(a,b) // a to the power b
Math.pow(2,3) => 8
Math.log(a) // log of a base e ලඝු
Math.tan(a) // tangent of a ටැන්ජනය
Math.sin(a) // sine of a සයින්
Math.cos(a) // cosine of a කොස්
Math.round(a) // integer closest to a රවුම් සංඛ්යා
Math.exp(a) // exponent of a
Math.floor(a) // integer closest to and not greater than a
Math.random() // random number in the range 0 to 1 අහඹු සංඛ්යා
Math.acos(a) // arc cosine of a
Math.asin(a) // arc sine of a
Math.atan(a) // arc tangent of a
Math.atan2(a,b) // arc tangent of a/b
Math.ceil(a) // integer closest to a and not less than a
