Jump to content

"bitshift" in MathScript generates unexpected results for certain


Recommended Posts

Posted

The "bitshift" is used to perform a bitwise shift on the input elements.

When the input is 0, the results always return the value of 2^n, no matter what the shift size n is.

e.g., bitshift(0, 4)=16 (10000)

bitshift(0, 8)=256 (100000000)

the behavior is same as the result for 1:

bitshift(1, 4)=16 (10000)

Posted

Hi captainjin,

According to the MathScript help, the first input to bitshift must be a scalar, vector, or matrix of positive integers, so the results when you input zero are technically undefined. But this seems like a silly limitation, so we've reported this to LabVIEW R&D as a bug (CAR# 53118).

Thanks,

JesseA

LabVIEW R&D

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.