# JavaScript: Math Operations

x = 16; y = Math.sqrt(x); document.write(y);

*(will display the answer "4")*

And here is the sine of x:

z = Math.sin(x); document.write(z);

*will display the answer "-0.2879033166650653")*

You can convert a number to a string:

a = x.toString(10);

*(will display "16")*

You can specify the base:

a = x.toString(16);

*("10")*

a = x.toString(2);

*("10000")*