Difference between revisions of "BITTEST()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to test the value of a specified bit in a numeric value
 
Function to test the value of a specified bit in a numeric value
 
  
 
==Syntax==
 
==Syntax==
 
BITTEST(<expN1>,<expN2>)
 
BITTEST(<expN1>,<expN2>)
 
  
 
==See Also==
 
==See Also==
 
[[BITAND()]], [[BITCLEAR()]], [[BITLSHIFT()]], [[BITNOT()]], [[BITOR()]], [[BITRSHIFT()]], [[BITSET()]], [[BITXOR()]]
 
[[BITAND()]], [[BITCLEAR()]], [[BITLSHIFT()]], [[BITNOT()]], [[BITOR()]], [[BITRSHIFT()]], [[BITSET()]], [[BITXOR()]]
 
  
 
==Description==
 
==Description==
 
The BITTEST() function tests the value of the specified bit <expN2> in a numeric value <expN1>.  If the bit is 1, BITTEST() returns True (.T.), otherwise it returns False (.F.).  If <expN1> and <expN2> are not integers, they will be converted to integer values before the clear takes place.  The bit position, <expN2>, can range from 0 (rightmost bit) to 31.
 
The BITTEST() function tests the value of the specified bit <expN2> in a numeric value <expN1>.  If the bit is 1, BITTEST() returns True (.T.), otherwise it returns False (.F.).  If <expN1> and <expN2> are not integers, they will be converted to integer values before the clear takes place.  The bit position, <expN2>, can range from 0 (rightmost bit) to 31.
 
  
 
==Example==
 
==Example==
Line 26: Line 22:
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
 
[[Category:Bitwise Operations]]
 
[[Category:Bitwise Operations]]
 
[[Category:Bitwise Operations Functions]]
 
[[Category:Bitwise Operations Functions]]

Revision as of 11:37, 7 December 2012

Purpose

Function to test the value of a specified bit in a numeric value

Syntax

BITTEST(<expN1>,<expN2>)

See Also

BITAND(), BITCLEAR(), BITLSHIFT(), BITNOT(), BITOR(), BITRSHIFT(), BITSET(), BITXOR()

Description

The BITTEST() function tests the value of the specified bit <expN2> in a numeric value <expN1>. If the bit is 1, BITTEST() returns True (.T.), otherwise it returns False (.F.). If <expN1> and <expN2> are not integers, they will be converted to integer values before the clear takes place. The bit position, <expN2>, can range from 0 (rightmost bit) to 31.

Example

x = 6			&& 0110
y = 3
z = 2
? bittest (x,y)
.F.
? bittest (x,z)
.T.