SUNY Geneseo Department of Mathematics
Thursday, September 17
Math 303
Fall 2015
Prof. Doug Baldwin
times( x, y ) // initial x, y are x0, y0
product = 0
while x > 0 // inv: product + xy = x0y0
if x is even
x = x/2
y = 2 * y
else // x is odd
x = x-1
product = product + y
end of if
end of while
return product