
- Javascript Basics Tutorial
- Javascript - Home
- Javascript - Overview
- Javascript - Syntax
- Javascript - Enabling
- Javascript - Placement
- Javascript - Variables
- Javascript - Operators
- Javascript - If...Else
- Javascript - Switch Case
- Javascript - While Loop
- Javascript - For Loop
- Javascript - For...in
- Javascript - Loop Control
- Javascript - Functions
- Javascript - Events
- Javascript - Cookies
- Javascript - Page Redirect
- Javascript - Dialog Boxes
- Javascript - Void Keyword
- Javascript - Page Printing
- JavaScript Objects
- Javascript - Objects
- Javascript - Number
- Javascript - Boolean
- Javascript - Strings
- Javascript - Arrays
- Javascript - Date
- Javascript - Math
- Javascript - RegExp
- Javascript - HTML DOM
- JavaScript Advanced
- Javascript - Error Handling
- Javascript - Validations
- Javascript - Animation
- Javascript - Multimedia
- Javascript - Debugging
- Javascript - Image Map
- Javascript - Browsers
- JavaScript Useful Resources
- Javascript - Questions And Answers
- Javascript - Quick Guide
- Javascript - Functions
- Javascript - Resources
What are JavaScript Math Functions?
The following are some of the Math Functions in JavaScript −
S.No | Method & Description |
---|---|
1 | abs() Returns the absolute value of a number. |
2 | acos() Returns the arccosine (in radians) of a number. |
3 | asin() Returns the arcsine (in radians) of a number. |
4 | atan() Returns the arctangent (in radians) of a number. |
5 | atan2() Returns the arctangent of the quotient of its arguments. |
6 | ceil() Returns the smallest integer greater than or equal to a number. |
Example
Let’s see an example of abs() Math function in JavaScript. The Math() function returns the absolute value of a number −
<html> <head> <title>JavaScript Math abs() Method</title> </head> <body> <script> var value = Math.abs(-1); document.write("First Value : " + value ); var value = Math.abs(5); document.write("<br />Second Value : " + value ); var value = Math.abs("string"); document.write("<br />Third Value : " + value ); </script> </body> </html>
- Related Articles
- JavaScript: How to Find Min/Max Values Without Math Functions?
- What are functions in JavaScript?
- What are JavaScript Nested Functions?
- What are JavaScript Factory Functions?
- What is math object in JavaScript?
- What are callback functions in JavaScript?
- What are generator functions in JavaScript?
- What are immediate functions in JavaScript?
- What are Partial functions in JavaScript?
- What is Math Object in JavaScript Program?
- What are optional arguments in JavaScript Functions?
- What are Rest parameters in JavaScript functions?
- JavaScript Math Object example
- What are Self-Invoking Anonymous Functions in JavaScript?
- Math. fround() function in JavaScript

Advertisements