by bbcbasic · 11y ago · 0 comments
Maybe I don't understand what the word recursion means, but I thought that you'd have to call yourself directly or indirectly.
You could state it that the multiple by a power of two is the sum of the multiples of one order of magnitude base 2 lower.
By these definitions, all but the most trivial code is recursive.
// e is a power of two
int mult(x, e)
return e==1 ? x : mult(x, e/2) + mult(x, e/2)
end