c - Bitshift to multiply by any number -
How can I multiply an integer with a given number, only by adding, subtracting and using bitsfösting?
I know that the transfer is growing by a multi of 2 and the right place is divided by the power of 2, but I do not know how to normalize it is to know
What about negative numbers? Change the complement of the two and do the same process?
( Edit: OK, I've got it, never. You convert to complement of two, and then you change according to number from left to right To the left.) Now the difficult part has come. We can only use 3 operators. For example, by multiplying by 60, I can complete it using: Where As far as I know, it is easy to multiply in general using only 3 operators Not the way. It is possible to multiply with 60, 60 = 64 - 4:
(x <5> + 5) + ( X <-0>
x > That's the number that I'm multiplying. But this is the 7 operator - how can I use it only 3?
(x
Comments
Post a Comment