Error in the Algorithm Design Manual? Take a look at this excerpt from the Algorithm Design Manual, 2nd Edition by Skiena.




I have circled the confusing bit. Basically, everything is understandable to me, until that part. How can $Increment([m+1/2])$ be rewritten as $Increment([m])$? Clearly, if m is an integer, then the algorithm will not treat $m+1/2$ as $m$ and return $m+1$. Instead, $Increment$ is going to go into the $else$ clause and return $m+1/2+1$, which is clearly not $m+1$. Am I missing something here?
How can $Increment([m+1/2])$ be rewritten as $Increment([m])$?


Recall that $[x]$ means the greatest integer less than or equal to $x$.

Since $m$ is integer, $m$ is the less than $m+0.5$ and $m+0.5 &lt; m+1$. Thus the the greatest integer less than or equal to $m+0.5$ is $m$.