Tutorial Gateway

  • C
  • C#
  • Java
  • Python
  • SQL
  • MySQL
  • Js
  • BI Tools
    • Informatica
    • Talend
    • Tableau
    • Power BI
    • SSIS
    • SSRS
    • SSAS
    • MDX
    • R Tutorial
    • QlikView
  • More
    • C Programs
    • C++ Programs
    • Python Programs
    • Java Programs
    • SQL FAQ’s

JavaScript Math Functions

by suresh

The JavaScript Math Objects provides various Functions and Constants / Properties, which allows us to perform mathematical functions.

Unlike other global objects, Properties and Functions are available inside the math object is static. So, we can access the properties as Math.PI and JavaScript math functions as Math.abs(number).

JavaScript Math Object Properties

The following table will show you the list of Properties or Constants available in JavaScript Math Object

JavaScript Math PropertiesDescription
Math.EIt will return the Euler’s Number e, approximately equal to 2.71828
Math.LN2It will return Natural Logarithm of 2, approximately equal to 0.693
Math.LN10This JavaScript Math Function returns the Natural Logarithm of 10, approximately equal to 2.302
Math.LOG2EIt will return Logarithm of E base 2, approximately equal to 1.443
Math.LOG10EIt will return Logarithm of E base 10, approximately equal to 0.434
Math.PIThis JavaScript Math Function returns the Pie Value, approximately equal to 3.14
Math.SQRT1_2It returns Square Root of 1/2 or 0.5, approximately equal to 0.707
Math.SQRT2It will return Square Root of 2, approximately equal to 1.414

JavaScript Math Object Methods

The following table will show you the list of Functions available in JavaScript Math Object. To use the below functions, we have to use the Math object as a prefix. For example, Math.abs(x)

JavaScript Math FunctionsDescription
abs(x)It returns the Absolute value of a Given number
acos(x)It will return the ArcCosine value of a Given number
acosh(x)Used to return the Hyperbolic Arc Cosine (inverse Hyperbolic Cosine) value of a supplied number
asin(x)This JavaScript Math Function will return the Arc Sine value of a number
asinh(x)It will return the Hyperbolic Arc Sine (inverse Hyperbolic Sine) value of a supplied number
atan(x)This returns the Arc Tangent value of a Given number
atan2(y, x)It will return the angle (in radius) from the X-Axis to the specified point (y, x).
cbrt(x)Used to find the Cube Root of a supplied number
atanh(x)Returns the Hyperbolic Arc Tangent (inverse Hyperbolic Tangent) value of a number
ceil(x)It is used to return the smallest integer value which is greater than or equal to the specified expression or a number.
cos(x)This returns the Cosine value of a Given number
cosh(x)Return the Hyperbolic Cosine value of a supplied number
exp(x)It is used to calculate the power of E, Where E is Euler’s number approximately equal to 2.71828.
floor(x)This JavaScript Math Function returns the largest integer value which is less than or equal to the specified expression or a number.
hypot(value1, value2,…..valueN)It will extract the characters from a string based on the specified indices
log(x)It calculates the logarithmic value of specified number with base E.
max(1, 2, 3, …..n)It is used to return the Maximum or Largest value from the specified set of expression
min(1, 2, 3, …..n)This JavaScript Math Function return the Minimum or Smaller value from the specified set of expression
pow(x, y)It is used to calculate the Power of the specified expression
random()This function will return the random number between 0 and 1
round(x)It is used to round the specified expression or an individual number to the nearest integer.
sign(x)This JavaScript Math Function returns the sign of a Given number. For instance, Positive, Negative or Zero
sin(x)Return the Sine value of a number
sinh(x)Return the Hyperbolic Sine value of a specified number
sqrt(x)It is used to find the square root of a specified expression or an individual number
tan(x)Return the Tangent value of a specified number
tanh(x)This JavaScript Math Function returns the Hyperbolic Tangent value of a number
trunc(x)It is used to remove the decimal values from specified expression and return the integer value

Placed Under: JavaScript

  • SQL DML, DDL, DCL & TCL Cmds
  • SQL NOT EXISTS Operator
  • SQL UPDATE from SELECT
  • SQL AFTER UPDATE Triggers
  • SQL Get Column Names in Table
  • SQL IF ELSE
  • SQL ACID Properties
  • SQL FOR XML PATH
  • Java Two Dimensional Array
  • Java Perfect Number Program
  • Java Count Digits in a Number
  • C Compare Two Strings Program
  • C Print Prime Numbers 1 to 100
  • C program to Reverse a String
  • C Palindrome Number Program
  • C Program for Palindrome String
  • C Remove Duplicate String Chars
  • C Square of a Number Program
  • C Sum and Average of N Number
  • Python Fibonacci Series program
  • Python Area Of Circle Program
  • Python Prime Numbers 1 to 100
  • Python Program for Leap Year
  • Tableau Rank Calculation
  • Tableau Google Maps usage
  • Power BI Format Dates
  • Power BI Top 10 Filters
  • Power BI – Create Hierarchy
  • Power BI DAX Math Functions
  • Learn SSIS in 28 Days
  • SSIS Transformations
  • SSIS Incremental Load
  • SSRS Drill Through Reports
  • SSRS Drill Down Reports
  • R Programming Tutorial
  • C Tutorial
  • C# Tutorial
  • Java Tutorial
  • JavaScript Tutorial
  • Python Tutorial
  • MySQL Tutorial
  • SQL Server Tutorial
  • R Tutorial
  • Power BI Tutorial
  • Tableau Tutorial
  • SSIS Tutorial
  • SSRS Tutorial
  • Informatica Tutorial
  • Talend Tutorial
  • C Programs
  • C++ Programs
  • Java Programs
  • Python Programs
  • MDX Tutorial
  • SSAS Tutorial
  • QlikView Tutorial

Copyright © 2021 | Tutorial Gateway· All Rights Reserved by Suresh

Home | About Us | Contact Us | Privacy Policy