Math methods Flashcards
What does the function Maths.abs() do?
Returns the absolute value of a number.
What does the function Math.ceil() do?
Rounds the number up and returns the smaller integer greater than or equal to a given number.
What does the function Math.floor() do?
Always rounds down and returns the largest integer less than or equal to a given number.
What does the function Math.fround() do?
Returns the nearest 32-bit single precision float representation of a number.
What does the function Math.max() do?
Returns the largest of the numbers given as input parameters, or infinity if there are no parameters.
What does the function Math.min() do?
Returns the smallest of the numbers given as input parameters, or infinity if there are no parameters.
What does Math.pow() method do?
Returns the value of a base raised to a power.
What does Math.random() do?
Returns a floating-point, pseudo-random number that’s greater or equal to 0 and less than 1.
What does the function Math.round() do?
Returns the value or a number rounded to the nearest integer.
What does the function Math.sign() do?
Returns 1 or -1, if the number is positive it returns 1, if negative it returns -1.
What does the function Math.sqrt() do?
Returns the square root of a number.
What does the function Math.trun() do?
Returns the integer part of a number by removing any fractional digits.