In flash, the math class is a very common class. Through mathematical computation, we can achieve a lot of wonderful results. Here we will start from the most basic learning and add a math knowledge.
Let's take a look at the math class provided in
This article briefly introduces Date (Date object) and Math object in JavaScript. For more information, see
Date object
1. What is a Date object?
A date object can store any date, and can be precise to the number of milliseconds (1/1000 seconds
1. Discard the fractional part and retain the integer part.Parseint (5/2)
2. rounded up. If there is a decimal number, add 1 to the integer part.
Math. Ceil (5/2)
3. rounding.
Math. Round (5/2)
4. Round down
Math. Floor (5/2)
Math object MethodFF:
In javascript, how does random number math random generate a random number in a specified range? mathrandom
Today, a friend asked me how to generate a random number in the specified range in JavaScript. Math. random () is used to generate random
Math is a mathematical class in Java, which records many of them.ProgramMathematical aspects to be used, such as two constants:
The circumference rate of the math. Pi record
Math. E records the constant of E.
Math has some similar constants,
The circumference rate of the Math. PI record
Math. E records the constant of e.
Math has some similar constants, which are commonly used in Engineering Mathematics.
Math. abs evaluate absolute value
Math. sin sine function Math. asin arcsin
In js, Math functions can include various methods, such as Math. random (): Math. round (); Math. floor (); and Math. ceil (); opposite, Math. floor (); let me introduce it later.
Math functions are mainly used to process numbers.
Math. random ():
1. mathematical operations defined by math objects
Javascript supports some complex arithmetic operations. These complex operations are implemented by using functions and constants defined as attributes of the math object:
Math. Pow (9007199254740992
Some Math object methods can implement some mathematical calculations in our textbooks. The following are commonly used methods:
1. Math. min () and Math. max () return the minimum and maximum values of the parameters respectively.
Example:
Alert
1. Math. min () and Math. max () return the minimum and maximum values of the parameters respectively. Example:Alert (Math. min (1, 2, 3) // output "1"Alert (Math. max (1, 2, 3) // output "3"2. Math. abs () returns the absolute value of the
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.