I should warn, this is a pretty challenging problem, and this post is the result of me giving up after about a week of work and five hours of straight research.

So, here’s the problem. I have two numbers, `2863311530`

, and 2^n, and I want to perform a bitwise AND operation on them. I can’t use any recursion loops (too slow), so if anyone has any way to do this, that would be amazing!

Also, becuase I’m using a 32 bit (unsigned) number, and 2^n, the answer will always be 2^n or 0.

I did do some research as mentioned above, and found the following:

(Google Answers: Bitwise Operators)

(computer science - Is there any mathematical operation on Integers that yields the same result as doing bitwise "AND"? - Mathematics Stack Exchange)

(Expressing bitwise operations in terms of other functions - Mathematics Stack Exchange)

Here is an example of a solution that does not work, becuase it uses a loop:

Thanks,

Blackhole927

21 Likes

Ok, thanks for the heads up!

5 Likes

Yeah, I had no idea that there was a challenge for that.

6 Likes

But what else was I supposed to say?

8 Likes

Blackhole927 was asking for any possible solutions or further information on Bitwise Operations in Gimkit, so something along those lines.

6 Likes

Okay, maybe a elementary student will not understand anything on what these random words all say.

7 Likes

It’s ok lol. There have been many times where I misread something, or understood it differently, and only realized later that my reply didn’t make sense.

6 Likes

@LxmasHaxTakis is that a insult or no…?

7 Likes

Lxmas is saying he has no clue what im talking about, because he is in elementary school.

11 Likes

Answer is a=356^4 Honestly idk the answer and I don’t think there is one.

10 Likes

So thats the math for doing a bitwise and operation, but it uses loops. So it gets the result, but gimkit will lag if i implement it with recursion.

11 Likes

well uh

i’m still confused

5 Likes

Loops are like wire repeaters in programming.(sort of) That’s the only thing I can comprehend from this.

8 Likes

I think everyone but @Blackhole927 is confused.

7 Likes

*cough x4*

i still do not understand

5 Likes