Answer
Multiply by 8 via shift and substract the number:
int multiply(int num)
{
return (num << 3) - num;
}
...
Search results for multiply, shift
How to fast multiply a number by 7?
Posted by CMaster
Answer:
int Double(int Number)
{
return (Number >> 1);
}
Note that the fractional part is rounded down.
...
« previous1 next »
