• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 11. Manipulating Information > Calculations with the Math Object

Calculations with the Math Object

The Math object lets you access trigonometric functions such as sine, cosine, and tangent; logarithmic functions; rounding functions; and mathematical constants such as pi or e. The methods and properties of the Math object are summarized in Table 11.1. As with the Key object, you don't need to instantiate the Math object in order to call on its methods or properties, and all of the Math object's properties are read-only values and written in all capital letters. You precede the method with the object Math. For example, to calculate the square root of 10, you write:

myAnswer = Math.sqrt (10)


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint