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;
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
2.
if x >= 0 then
return x - x%1;
else
return x-x%1+1
end