Using Shift operators makes the process faster..
instaed of / use >>
eg half=whole>>1;

Hope this helps