Today's Question:  What does your personal desk look like?        GIVE A SHOUT

 ALL


  Implementation of +,-,*,/ with bitwise operator

There is a question asked on Stackoverflow : Divide a number by 3 without using *,/,+,-,% operators. This question is an Oracle interview question. Some people give excellent answers. You can go there and take a look. Usually we need to use bitwise operators to do this kind of implementations. Here I want to show you ways to implement +,-,*,/ with bitwise operators.A bitwise operation operates on one or more bit patterns or binary numerals at the level of their individual bits. It is a fast, primitive action directly supported by the processor, and is used to manipulate values for comparisons ...

39,155 3       DIVISION BITWISE OPERATOR SHIFT ADD SUBTRACT MULTIPLICATION


  Dividing any number By 9, 90, 900 and so on

Thetechnique for Dividing any number by 9 mentally is simply to reduce a complex divisionto a very simple addition. The technique can be applied from both ends i.e. from right-most digit or from left-most digit. Dividingby 9 into a mixed number from right-most digit uses the Divisibility Rules for9:1.     First, add all the digitstogether and divide by 9, keeping in mind the whole number and the remainder.2.     Write the remainder over 9, thisis the fraction part of the answer. (Make sure the fraction is in simplestform.)3.     Add a...

6,157 0       ALGORITHM 9 90 DIVISION