10.07.2017 Views

javascript_tutorial

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Javascript<br />

number.<br />

log()<br />

max()<br />

min()<br />

pow()<br />

Returns the natural logarithm (base E) of a number.<br />

Returns the largest of zero or more numbers.<br />

Returns the smallest of zero or more numbers.<br />

Returns base to the exponent power, that is, base<br />

exponent.<br />

random() Returns a pseudo-random number between 0 and 1.<br />

round()<br />

sin()<br />

sqrt()<br />

tan()<br />

toSource()<br />

Returns the value of a number rounded to the nearest<br />

integer.<br />

Returns the sine of a number.<br />

Returns the square root of a number.<br />

Returns the tangent of a number.<br />

Returns the string "Math".<br />

In the following sections, we will have a few examples to demonstrate the usage<br />

of the methods associated with Math.<br />

abs ()<br />

This method returns the absolute value of a number.<br />

Syntax<br />

Its syntax is as follows:<br />

Math.abs( x ) ;<br />

Parameter Details<br />

x: A number.<br />

Return Value<br />

Returns the absolute value of a number.<br />

Example<br />

283

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!