Author |
Topic: Multiply x with y without using +,* (Read 898 times) |
|
mcprabhakaran
Junior Member
Posts: 62
|
|
Multiply x with y without using +,*
« on: May 16th, 2007, 4:09am » |
Quote Modify
|
Hi Friends, Tell me some ideas about multiplying a number x with y without using +,*; For example n*7 can be done by (n<<3)- n Whether there is a common algorithm for this? If it is suggest me.
|
|
IP Logged |
|
|
|
Grimbal
wu::riddles Moderator Uberpuzzler
Gender:
Posts: 7527
|
|
Re: Multiply x with y without using +,*
« Reply #1 on: May 16th, 2007, 4:50am » |
Quote Modify
|
Since it is not forbidden: x/(1.0/y). or exp(ln(x)-(-ln(y))) Assuming we are dealing with floats or doubles.
|
|
IP Logged |
|
|
|
mcprabhakaran
Junior Member
Posts: 62
|
|
Re: Multiply x with y without using +,*
« Reply #2 on: May 16th, 2007, 4:58am » |
Quote Modify
|
Thank U very Much...
|
|
IP Logged |
|
|
|
|