MATLAB Answers

bitget() and MSB/LSB

20 views (last 30 days)
David C
David C on 28 Sep 2011
I would like to clarify the functionality of bitget(). In the documentation, it is noted that "The output of bitget is independent of the endian settings of the computer you are using."
Question: Would bitget(binaryVector,1) always return the LSB of binaryVector, regardless of whether my machine is big-endian or little-endian?
Thanks, David


Sign in to comment.

Accepted Answer

Jan on 28 Sep 2011
Yes. BITGET is not influenced by the endianess of the machine. Therefore bitget(x, 1) and mod(x, 2) are equivalent, if x is a non-negative integer.

  1 Comment

David C
David C on 2 Oct 2011
Thanks Jan!

Sign in to comment.

More Answers (0)

Translated by