Question: Rounding to integer

Hey peeps

 

I'm quite new to maple, and to this site, so I hope I do this properly.

I'm trying to make a procedure, that througout the procedure divides 2 numbers. But I need it to round down to the nearest integers, at all time, as I need an integer as output. I have searched quite a lot, and haven't found anything that helps me to do this.

The procedure is the following:

walla := proc (x) local y, z, w;

y := x;

z := x;

w := 0;

while not (y^2 <= x and x < y^2+1) do

if y^2 < x then

w := y; y := (1/2)*y+(1/2)*z

else

z := y;

y := (1/2)*y+(1/2)*w

end if

end do;

return y

end proc

 

As said, this needs an intteger as output.

Thanks in advance.. :)

Please Wait...