--取一个数的整数部分
function getIntPart(x)
if x<= 0 then
return math.ceil(x)
end
if math.ceil(x) == x then
x = math.ceil(x)
else
x = math.ceil(x)-1
end
return x
end
function getIntPart(x)
if x<= 0 then
return math.ceil(x)
end
if math.ceil(x) == x then
x = math.ceil(x)
else
x = math.ceil(x)-1
end
return x
end
本文介绍了一种方法来从给定数值中提取其整数部分,并通过代码实现这一过程。
673

被折叠的 条评论
为什么被折叠?



