Matlab

BIT-WISE OPERATOR And SHORT CIRCUIT OPERATOR

BIT-WISE OPERATOR:

In bit-wise operator logical bit-wise operation is performed for positive integer input, where the input may be scalar or array. Below shows some functions of bit-wise operator.

Bitand       it performs the bit-wiseAnd operation on two positive integers.

For example: A = 28;         % binary 11100
                  B = 21;         % binary 10101

bitand (A, B) = 20
(binary 10100)

Bitor          it performs the bit-wiseor operation on two positive integers.

For example: A = 28;         % binary 11100
                  B = 21;         % binary 10101

bitor(A,B) = 29
(binary 11101)

Bitcmp   It returns the bit-wise complement as an n-bit number, where n is the second input argument to bitcmp.

    For example: A = 28;         % binary 11100
                  B = 21;         % binary 10101

bitcmp(A,5) = 3
(binary 00011)

Bitxor      It returns the bit-wise exclusive OR of two nonnegative integer arguments.

                                  For example: A = 28;         % binary 11100
                                                        B = 21;         % binary 10101

Bitxor (A,B) = 9
(binary 01001)

SHORT CIRCUIT OPERATOR:

 Short-circuit operator used when first operand does not determine the output fully we consider the short-circuiting operator to calculate the second operand.

&& It returns logical 1 (true) if both inputs calculate to true, and logical 0 (false) if they do not.


|| It returns logical 1 (true) if either input, or both, calculate to true, and logical 0 (false) if they do not.

RELATIONAL OPERATOR:

Relational operator performs element by element comparison between two arrays. They return a logical array of the identical size.

A < B                  A Less than B
A > B                  A Greater than B

A <= B                 A Less than or equal to B

C >= D                C Greater than or equal to D
A == B                 A Equal to B
A ~= B                 A Not equal to B
Rajeshwari Chiluveru

Share
Published by
Rajeshwari Chiluveru

Recent Posts

Google Spam Update 2025: Impact, Recovery Guide & SpamBrain Explained

Google released a spam update on 26th of August 2025 and this is affecting a…

3 weeks ago

Google Experiments with Black Sitelink Colors instead of Blue

Google keeps on testing google search display all the time and this time we are…

1 year ago

What are Template Tags in WordPress? How to Use Template Tags

In wordpress if you are developing new or custom wordpress theme or wordpress plugin then…

2 years ago

Google Search Indexing Issues Started on 31st January to February 2024

If you are experiencing indexing issues of your website then you are not alone and…

2 years ago

Create QR Code for Pages & Post using Plugin in WordPress

On your wordpress website if you want to generate qr code for pages and posts…

2 years ago

Add Google Search Console HTML File Upload on WordPress

If you are trying to verify your WordPress website with google search console with html…

2 years ago