I want to multiple tow values with out using * (i.e. 5*3=15)..
Is there any way....
The 'Russian peasants' method which is bit shifting and adding basically; e.g.
5*3 (3 is odd so remember the left operand == 5)
shift the left operand to the left and the right operand to the right
10*1 (1 is odd so remember the left operand == 10)
shift the left operand to the left and the right operand to the right
20*0 (the right operand equals zero so add the remembered left operands:
5+10 == 15.
If the right operand is even don't remember the left operand but take the next step
that shifts both operands.
Whenever you left shift the x number with y number, the value of x becomes x*(2^y). You can use this method for certain multiplications ...
lets say you want to multiply 3*7
3<<3 which becomes 3*(2^3) == 3*(8)...But you are supposed to multiply with 7 not 8..so just substract 3 from the answer..
i.e.
Ans = ( (3<<3) - 3 )
Put the text "what is 3 times 5" in a string, add it to the string "http://www.google.co.u k/search?q=" converting spaces to + to give "http://www.google.co.u k/search?q=what+i s+3+times+5".
Open a TCP socket on port 80 to www.google.com and using the appropriate headers request the URL string you have just created.
Read back the results page returned by google.com and parse it for the answer, 15 by looking for the text "3 times 5".
You can in fact use this method for a whole host of maths operations so I suggest that next time the revise the C/C++ standards they remove all the maths operators as they are clearly unrequired.
You can in fact use this method for a whole host of maths operations so I suggest that next time the revise the C/C++ standards they remove all the maths operators as they are clearly unrequired.
Pointy haired manager remark: "install a copy of that google on every machine
that has to be operational off line; here's a floppy disk"
Generic Programming and the STL - Using and Extending the C++ Standard Template Library.
You can write a Template which can deal with different types.
2. Train a feedforward neural network by using Matlab, which is a black box, you just need to pre-process and postprocess your input and output based on some data mining method, such as gaussion distribution, histgram etc.
Generic Programming and the STL - Using and Extending the C++ Standard Template Library.
You can write a Template which can deal with different types.
2. Train a feedforward neural network by using Matlab, which is a black box, you just need to pre-process and postprocess your input and output based on some data mining method, such as gaussion distribution, histgram etc.
leejwen- please check your PM's, visible under the Network header at the top of the page
Last edited by sicarie; Aug 18 '08, 04:20 PM.
Reason: Caught the sarcasm
Comment