ezeio2:expref:bit

This is an old revision of the document!


Returns the status of the given bit in an integer value

Description

bit(19, 1)

Returns the value of bit 1 (the second bit) in the value 19.

19 (decimal) written as binary is 10011. Thus, bit 0, 1 and 4 are set.

Parameters

value The input value (64 bit integer)
bitno The bit number to return

Return value

Returns 1 if the bit is set. 0 if the bit is not set.

Example usage

bit(211, 5) // returns 0
bit(211, 4) // returns 1

[Available in firmware 201008 and newer]

  • ezeio2/expref/bit.1602205457.txt.gz
  • Last modified: 2020-10-09 01:04
  • by andreh