关于JavaScript中的Math对象的说法,正确的是( )
A: Math.ceil(512.51)返回的结果为512
B: Math.floor( )方法用于对数字进行下舍入
C: Math.round(-512.51)返回的结果为-512
D: Math.random( )返回的结果范围为0-1,包括0和1
A: Math.ceil(512.51)返回的结果为512
B: Math.floor( )方法用于对数字进行下舍入
C: Math.round(-512.51)返回的结果为-512
D: Math.random( )返回的结果范围为0-1,包括0和1
B
举一反三
- 对于Math对象的常用方法,以下描述不正确的是( )。 A: ceil()向上舍入 B: floor()向下舍入 C: round()四舍五入 D: random()返回0~1中的随机数,包括0和1
- Math对象的( )方法是返回 0 ~ 1 之间的随机数? A: random() B: round() C: sin() D: sqrt()
- 下面那个语句可返回x的整数部分 A: import math math.ceil(x) B: from math import ceil ceil(x) C: import math math.trunc(x) D: import math math.fabs(x)
- Javascript里Math的_________________方法返回介于0和1之间的随机数
- Math对象的哪个方法可以返回小于等于参数的整数?() A: round() B: pow() C: floor() D: ceil()
内容
- 0
使用Math类调用其类方法random()返回一个0至1之间的随机数包括1。
- 1
Math对象的( )方法返回 0 ~ 1 之间的随机数。 A: abs(x) B: ceil(x) C: andom() D: ound(x)
- 2
Math中的random()方法用来获取随机数,每次调用该方法返回的结果都不同。
- 3
使用Math类的方法中,-4.4通过哪个方法运算后,结果为-5.0?( ) A: round B: min C: floor D: ceil
- 4
在JavaScript中,String对象的说法不包括() A: ceil("8.9")返回值是9 B: floor("8.9")返回值是8 C: random()方法返回0和1之间的伪随机数,包括1,但不包括1 D: 需要使用new关键字创建Math对象的实例后,才能使用其方法