以下哪个方法的调用结果是整数类型结果3
A: Math.ceil(3.1)
B: Math.floor(2.7)
C: Math.abs(3.1)
D: Math.round(2.7)
A: Math.ceil(3.1)
B: Math.floor(2.7)
C: Math.abs(3.1)
D: Math.round(2.7)
D
举一反三
- 下面那个语句可返回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)
- Math对象的哪个方法可以返回小于等于参数的整数?() A: round() B: pow() C: floor() D: ceil()
- 使用Math类的方法中,-4.4通过哪个方法运算后,结果为-5.0?( ) A: round B: min C: floor D: ceil
- Math对象有3个取整函数分别是 floor、round、ceil。
- 以下Math类的方法中,-4.4通过哪个方法运算后,结果为-5.0? A: floor() B: ound() C: min() D: ceil()
内容
- 0
下列哪个不是Math对象的方法 A: sort() B: floor() C: random() D: abs()
- 1
以下哪个不是正确的引入math库或其函数的语句() A: import math B: from math import * C: from math import math D: import math as ma
- 2
下面关于Math对象描述正确的是 A: Math对象需要先实例化才能使用 B: Math对象的ceil()方法向上取整 C: Math对象有5个方 D: Math对象是自定义的对象
- 3
以下Math的方法运用中,哪个方法返回的值是9.0。( ) A: Math.floor(9.6); B: Math.sqrt(100); C: Math.max(9.0 , 10.0); D: Math.round(9.6);
- 4
以下导入语句中哪个是错误的: A: import math B: import math as m C: from math import pi D: import pi from math