亚洲综合在线一区,日韩欧美偷情高潮,久久伊人精品青青草原高清,中文字幕av解说

制作隨機選號器

zhushican 3年前 (2022-10-07) 六六互聯(lián) 1006 0

word; clear: both; text-indent: 2em; color: rgb(24, 30, 51); font-family: PingFangSC, 微軟雅黑, 黑體, Arial, Helvetica, sans-serif; font-size: 18px; background-color: rgb(255, 255, 255);">制作隨機選號器

word; clear: both; text-indent: 2em; color: rgb(24, 30, 51); font-family: PingFangSC, 微軟雅黑, 黑體, Arial, Helvetica, sans-serif; font-size: 18px; background-color: rgb(255, 255, 255);">Math對象

Math對象的內(nèi)置方法可以在不使用構(gòu)造函數(shù)創(chuàng)建對象時直接調(diào)用。使用Math對象的屬性時,常用格式如下:

        Math.屬性

Math對象的常用屬性                                   

 

屬性名

 
 

描述

 
 

E

 
 

自然對數(shù)的底數(shù)

 
 

LN2

 
 

2的自然對數(shù)

 
 

LN10

 
 

10的自然對數(shù)

 
 

LOG2E

 
 

2為底e的對數(shù)

 
 

LOG10E

 
 

10為底e的對數(shù)

 
 

PI

 
 

圓周率

 
 

SQRT1_2

 
 

1/2的平方根

 
 

SQRT2

 
 

2的平方根

 

Math對象的常用方法

                                     

 

方法

 
 

說明

 
 

ceil(數(shù)值)

 
 

大于等于該數(shù)值的最小整數(shù)

 
 

floor(數(shù)值)

 
 

小于等于該數(shù)值的最大整數(shù)

 
 

min(數(shù)值1,數(shù)值2)

 
 

最小值

 
 

max(數(shù)值1,數(shù)值2)

 
 

最大值

 
 

pow(數(shù)值1,數(shù)值2)

 
 

數(shù)值1的數(shù)值2次方

 
 

random()

 
 

0倒1的隨機數(shù)

 
 

round(數(shù)值)

 
 

最接近該數(shù)值的整數(shù)

 
 

sqrt(數(shù)值)

 
 

開平方根

 
 

abs、sin(弧度)、cos、tan、asin、acos、atan、exp、log