Bit.test() - Keithley 708B Reference Manual

Switching matrix
Hide thumbs Also See for 708B:
Table of Contents

Advertisement

Section 7: Command reference

bit.test()

This function returns the Boolean value (true or false) of a bit at the specified index position.
Type
TSP-Link accessible
Function
No
Usage
result = bit.test(value, index)
result
value
index
Details
This function returns result, which is the result of the tested bit.
The least significant bit value is at index position 1; the most significant bit is at index position 32.
If the indexed bit for value is 0, result is false. If the bit of value at index is 1, the returned value is true.
If index is bigger than the number of bits in value, the result is false.
Example
myResult = bit.test(10, 4)
print(myResult)
Also see
bit.clear()
(on page 7-11)
bit.get()
(on page 7-12)
bit.set()
(on page 7-14)
bit.toggle()
(on page 7-17)
Logical operators
7-16
Affected by
Result of the bit manipulation
Specified number
One-based bit position within value to test (1 to 32)
(on page 6-22)
Models 707B and 708B Switching Matrix Reference Manual
Where saved
Default value
The binary equivalent of decimal 10 is 1010.
Testing the bit at index position 4 returns a
Boolean value of true.
Output: true
707B-901-01 Rev. A / August 2010

Hide quick links:

Advertisement

Table of Contents
loading

This manual is also suitable for:

707b

Table of Contents