Math Constants and Functions using JavaScript

Math Constants and Functions using JavaScript

What's Math Constants and Functions using JavaScript?

View Answers

November 10, 2010 at 4:18 PM

The following are few Math Constants and Functions used in JavaScript

1)Math object contains useful constants such as Math.PI, Math.E

2)Math also has a zillion helpful functions.

3)Math.abs(value);-absolute value

4)Math.max(value1, value2);- Used for finding the largest value

5)Math.random()- generate a decimal number between 0 and 1

6)Math.floor(Math.random()*101)- generate a decimal number between 0 and 100









Related Tutorials/Questions & Answers:
Math Constants and Functions using JavaScript
Math Constants and Functions using JavaScript  What's Math Constants and Functions using JavaScript
associate functions with objects using JavaScript
associate functions with objects using JavaScript  How to associate functions with objects using JavaScript
Advertisements
JavaScript exp method
JavaScript exp method       We can perform the mathematical calculations in the JavaScript by using the Math object reference. In Math object we have some very useful
Boolean functions in JavaScript
Boolean functions in JavaScript  Explain about the Boolean functions present in Javascript
decodeURI() and encodeURI() functions in JavaScript
decodeURI() and encodeURI() functions in JavaScript  What are decodeURI() and encodeURI() functions in JavaScript
JavaScript Variadic functions
JavaScript Variadic functions  Explain about Variadic functions
Boolean functions present in Javascript
Boolean functions present in Javascript   Explain about the Boolean functions present in Javascript
JavaScript array of functions
in understanding a JavaScript array of functions. For this we are using Java Script... JavaScript array of functions   ...; Javascript_Array_of_functions.html <html>   <
delete an entry using JavaScript
delete an entry using JavaScript  How to delete an entry using JavaScript
Date object using JavaScript
Date object using JavaScript  What's the Date object using JavaScript
using for loop in javascript
using for loop in javascript  How to use for loop in JavaScript
maximize an image using javaScript
maximize an image using javaScript  Write the code to maximize an image using javaScript
xls to js using javascript
xls to js using javascript  ![how can we convert a xls file in js file using javascript][1
timer using javascript
timer using javascript  How to display timer on HTML page using JavaScript
send mail using JavaScript
send mail using JavaScript  How can we send mail using JavaScript?   Hi friends, You can not send email directly using JavaScript. But you can use JavaScript to execute a client side email program send the email using
How to shift and unshift using JavaScript?
How to shift and unshift using JavaScript?  How to shift and unshift using JavaScript
write a javascript progam to implement functions in html
write a javascript progam to implement functions in html  write a javascript progam to implement functions in html  Please visit the following link: http://www.roseindia.net/javascript/emailvalidation.shtml http
convert numbers to strings using JavaScript
convert numbers to strings using JavaScript  How to convert numbers to strings using JavaScript
read and write a file using javascript
read and write a file using javascript  How to read and write a file using javascript
set the focus on an element using Javascript
set the focus on an element using Javascript  How to set the focus on an element using Javascript
checkboxes set to true using JavaScript
checkboxes set to true using JavaScript  To set all checkboxes to true using JavaScript
validate radio button using javascript
validate radio button using javascript  validate radio button using javascript
javascript array functions push
javascript array functions push var array = new Array(); var count = 0; function push(val){ array[count]=val; count
without using built-in functions
without using built-in functions  Hai sir... Please help me to solve this... Findout occurances of each string in every another string (built - in functions are not at all allowed) all, and, sand, falling wall and sand
Changing background color using JavaScript
Changing background color using JavaScript  Hi Sir Is there any way to change the background color using JavaScript ? Please mention code with your answer.   Hello Friend Pass the element & color in the given
javascript date validation using regex
javascript date validation using regex  Hi, I want to validate the date using javascript. Please help.   <html> <head> <title>Validating Date format</title> <script type="text/javascript">
Solve using only Javascript loops...
Solve using only Javascript loops...  Write a JavaScript code, 1) to find a number of unique letters in string. (Eg. if keyword is unique, Unique count will be '4') 2) so that numbers appear in following format, 1 1 2
Defining Class Constants in JRuby
Defining Class Constants in JRuby       In this example you will learn about using Class Constants in JRuby program. Constants can be defined within the scope of  classes
how to give validation using javascript in swing
how to give validation using javascript in swing   how to give validation using javascript in swing....... can somebody give code for username and password validation using javscript and swing
How to write a search functionality using javascript/jquery
How to write a search functionality using javascript/jquery   How to write a search functionality using javascript/jquery for ex: im searching "s" names it wil display "s" names
use strings as array indexes using JavaScript
use strings as array indexes using JavaScript  How to use strings as array indexes using JavaScript
create a string from an array using JavaScript
create a string from an array using JavaScript  How to use "join()" to create a string from an array using JavaScript
force a page to go to another page using JavaScript
force a page to go to another page using JavaScript  How to force a page to go to another page using JavaScript
flowcharts using javascript/HTML - Development process
flowcharts using javascript/HTML  Hi I want to create flowchart diagram using html/javascript.. is that possible.. please guide me Thanks!  Check this linkhttp://www.roseindia.net/jdbc/jdbc-driver-and-its-types.shtml
JavaScript User Defined Functions
JavaScript User-Defined Functions: An user-defined function saves  us from  rewriting the same code again and again and helps us to make our... them to work. JavaScript has so many built-in functions, besides  that you
Calendar In JSP Using JavaScript
Calendar In JSP Using JavaScript   ... in JSP using JavaScript. We created the following files for the application...:150px;'><a href="javascript:window.close()">Window Close<
how to print HTML using javascript or Jquery
how to print HTML using javascript or Jquery  is there any way to print a document(created using Html and javascript) without using window.print, which works for all the browser specially chrome and firefox, I have used
Hide show HTML forms using javascript
Hide show HTML forms using javascript  How to hide a HTML form in my application using JavaScript?   HTML Code to create checkbox <...;div id="yourDiv"> ...other forms... </div> JavaScript function to hide
Html form using JavaScript to display the table content
Html form using JavaScript to display the table content  HI There, Greetings, I am new to this java and I need your assistance. I have created... want to write a Html JavaScript coding to display the content from database
How to check text in textbox using JavaScript
How to check text in textbox using JavaScript  How to check text in textbox using JavaScript I have a form in HTML that contains text feilds... me.   JavaScript validation example to check text in textfeild <
Accessing MS ACCESS databse using a HTML webpage [created using Javascript]
Accessing MS ACCESS databse using a HTML webpage [created using Javascript]  HI team, This is Srinivas, and I have a query and i explained here... I have to save some datas in an MS ACCESS database file [*.mdb], after
Difficulty using javascript in server side - Java Interview Questions
Difficulty using javascript in server side   why interaction with server using javascript is difficult
enabling and disabling a hyperlinks using javascript only
enabling and disabling a hyperlinks using javascript only  Hi! can...="javaScript" type="text/javascript" src="calendar.js"> function disableLink...; Please correct the code above if possible. Question 2: Is there a solution using
javascript for textbox or prompt using servlet - JSP-Servlet
javascript for textbox or prompt using servlet  Dear sir, I am using a prompt(),when a delete is confirmed,its working fine ,but when a prompt is closed or cancel ,i have to remain in the same page but here it is going
javascript for textbox or prompt using servlet - JSP-Servlet
javascript for textbox or prompt using servlet  Dear sir I am writing script in servlet,so prompt() is not working here so please help me...In my project when a vendors want to delete the uploaded file
Show spinner while loading image using JavaScript
Show spinner while loading image using JavaScript  Hello sir I am..._TO_REPLACE_2   You can do this by using the power of setTimeout..., and calling it won't block execution of the current / other functions. First
enabling and disabling a hyperlinks using javascript only
enabling and disabling a hyperlinks using javascript only  Hi! Anyone.... Question 2: Is there a solution using Java script only to achieve the problem... Question 2: Is there a solution using Java script only to achieve the problem
Making Tab using Javascript
Making Tab using Javascript  ... using javascript and css.For this we are going to make program named ...;text/javascript" src="domtab.js"></script>  
Displaying images using Javascript
Displaying images using Javascript... to display images using javascript and css.For this we are going to make program named...;type="text/javascript" src="image-slideshow-5.js">
how to save uploaded image in database using javascript
how to save uploaded image in database using javascript  Please can you tell me how to store uploaded image in database using java I'll use the upload code as extArray = new Array(".gif", ".jpg", ".png"); function LimitAttach

Ads