# JavaScript Math Object

The JavaScript Math object allows you to perform mathematical operations on numbers.

Unlike other global objects, the Math object has no constructor. Methods and properties are static.

All methods and properties can be used without creating a Math object first.

## Math.PI

The `Math.PI` property represents the ratio of the circumference of a circle to its diameter, approximately 3.14159.

Note: All properties and methods of Math object are static and can be called by using Math as an object, without creating it.

## Math.round()

The `Math.round(x)` method returns the value of x rounded to the nearest integer.

If the fractional portion of the argument is greater than 0.5, the argument is rounded to the integer with the next higher absolute value.

If it is less than 0.5, the argument is rounded to the integer with the lower absolute value.

If the fractional portion is exactly 0.5, the argument is rounded to the next integer in the direction of +∞.

## Math.pow()

The `Math.pow(x, y)` method returns the base to the exponent power, that is, baseexponent.

The first argument is the base number.

The second argument is the exponent used to raise the base.

## Math.sqrt()

The `Math.sqrt(x)` method returns the square root of x.

## Math.abs()

The `Math.abs(x)` method returns the absolute (positive) value of x.

## Math.ceil()

The `Math.ceil(x)` method returns the value of x rounded up to the next highest integer.

## Math.floor()

The `Math.floor(x)` method returns the value of x rounded down to the next lowest integer.

## Math.sin()

The `Math.sin()` method returns the sine of the specified number.

This method returns a numeric value between -1 and 1, which represents the sine of the angle given in radians.

## Math.cos()

The `Math.cos()` method returns the cosine of the specified number.

This method returns a numeric value between -1 and 1, which represents the cosine of the angle.

## Math.max() and Math.min()

The `Math.max()` method returns the number with the highest value in a list of arguments.

The `Math.min()` method returns the number with the lowest value in a list of arguments.

## Math.random()

The `Math.random()` method returns a random number from 0 (inclusive) up to but not including 1 (exclusive).

You will learn more about `Math.random()` in the next chapter.

## Complete Math Reference

For a complete properties and methods reference, visit our JavaScript Math Reference.

The reference section contains descriptions and examples of all Math properties and methods.