The SDL Component Suite is an industry leading collection of components supporting scientific and engineering computing. Please visit the SDL Web site for more information....



DecodeBit


Unit: SDL_math1
Class: None
Declaration: function DecodeBit (ix: integer): byte;

The function DecodeBit returns a byte which has the bit with the number ix set and all other bits reset. A value of ix outside the valid range (0..7) results in a zero byte as function return.The least significant bit (LSB) has the number 0, the most significant bit (MSB) has the number 7.

The following figure shows the results of a call to DecodeBin(10), which sets bit 10 to one and all other bits to zero. The resulting bit pattern is interpreted as an integer number:



Last Update: 2023-Feb-06