0

I am trying for several hours to calculate a boolean AND operation in Octave. It return a wrong number.

I want to calculate following numbers: result = 4037 & 63 result should be 5 but i get 1.

I also tried result = and(4037, 63) but i get 1 again

Why is this happening?

1
  • 1
    Your first clue to what is going wrong is that in your example, the type of result is logical rather than double. Commented Mar 10, 2024 at 15:01

1 Answer 1

2

Both approaches are not meant to be used for bitwise operations. Instead, you should use bitand function:

result = bitand(4037, 63)
Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.