Can you code multiplication with only LOGICAL operations like & , ^ , | , << , >> but, without + or - or * or / | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 4

Can you code multiplication with only LOGICAL operations like & , ^ , | , << , >> but, without + or - or * or /

If you interested in Logical Simulations join us

16th Apr 2022, 7:01 AM
Behzod
Behzod - avatar
14 Answers
16th Apr 2022, 8:36 AM
Lisa
Lisa - avatar
+ 2
What is it then? A challenge? You can put it in a challenge thread... If there is an issue with the code, can you please specify what isn't working? I get a compiler warning if I don't un-comment line 42, for example.
16th Apr 2022, 7:48 AM
Lisa
Lisa - avatar
+ 2
That is what is am saying: I get a compiler warning due to line 41
16th Apr 2022, 8:06 AM
Lisa
Lisa - avatar
+ 2
Try to run the code on sololearn playground. It a warning about "unused variable"
16th Apr 2022, 8:11 AM
Lisa
Lisa - avatar
+ 1
You ask a pseudo-question: you answer your own question immediately, mark your own answer as best and upvote it? Maybe you rather want to advertise your code in an advertising thread? https://www.sololearn.com/post/1398460/?ref=app
16th Apr 2022, 7:34 AM
Lisa
Lisa - avatar
+ 1
Lisa you may be true but it is not sharing have you opened or understand me what is shown on the code.
16th Apr 2022, 7:38 AM
Behzod
Behzod - avatar
+ 1
Lisa you dont need uncomment any line only you should enter two number
16th Apr 2022, 8:04 AM
Behzod
Behzod - avatar
+ 1
You are true that i havent pay attention to this But Lisa warning is not means the code is warking worse but if you also use unused var like me , it is not wrong But if you pay another attention to this code it returns addition of two numbs without + operand The mens of my checking my best ans to this quest is that the CODE IS ADDING WHITOUT + opr I want you help like this but not add BUT logical multiplication
16th Apr 2022, 8:20 AM
Behzod
Behzod - avatar
+ 1
Jacob Tracey i have banchmarked my code that you are really true Test Count: 1 234 567 890 times Result: (+) operand =>> 12s My func Add =>> 1m 43s my Add func is 9 times slower than (+) operand
16th Apr 2022, 11:18 AM
Behzod
Behzod - avatar
0
But i dont warning on my compiler What kind of warning is it Lisa
16th Apr 2022, 8:09 AM
Behzod
Behzod - avatar
0
Really good that i have tested Lisa
16th Apr 2022, 9:37 AM
Behzod
Behzod - avatar
0
Jacob Tracey not agree
16th Apr 2022, 9:48 AM
Behzod
Behzod - avatar
0
How it is written benchmark cant understan yuo a bit Jacob Tracey
16th Apr 2022, 10:07 AM
Behzod
Behzod - avatar
- 1
https://code.sololearn.com/c9raQdAX1A0K/?ref=app here is some code what I am explaning
16th Apr 2022, 7:03 AM
Behzod
Behzod - avatar