Difference between revisions of "BITSET()"

From Lianjapedia
Jump to: navigation, search
m (1 revision)
 
(One intermediate revision by one other user not shown)
Line 1: Line 1:
 
==Purpose==
 
==Purpose==
 
Function to set a specified bit in a numeric value
 
Function to set a specified bit in a numeric value
 
  
 
==Syntax==
 
==Syntax==
 
BITSET(<expN1>,<expN2>)
 
BITSET(<expN1>,<expN2>)
 
  
 
==See Also==
 
==See Also==
 
[[BITAND()]], [[BITCLEAR()]], [[BITLSHIFT()]], [[BITNOT()]], [[BITOR()]], [[BITRSHIFT()]], [[BITTEST()]], [[BITXOR()]]
 
[[BITAND()]], [[BITCLEAR()]], [[BITLSHIFT()]], [[BITNOT()]], [[BITOR()]], [[BITRSHIFT()]], [[BITTEST()]], [[BITXOR()]]
 
  
 
==Description==
 
==Description==
 
The BITSET() function sets the specified bit <expN2> in a numeric value <expN1> to 1and returns the new value.  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 BITSET() function sets the specified bit <expN2> in a numeric value <expN1> to 1and returns the new value.  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 23: Line 19:
 
</code>
 
</code>
  
 
==Products==
 
Recital Server, Recital
 
 
[[Category:Documentation]]
 
[[Category:Documentation]]
 
[[Category:Functions]]
 
[[Category:Functions]]
[[Category:Bitwise Operations]]
+
[[Category:Numeric Data Functions]]
[[Category:Bitwise Operations Functions]]
+

Latest revision as of 08:44, 4 February 2013

Purpose

Function to set a specified bit in a numeric value

Syntax

BITSET(<expN1>,<expN2>)

See Also

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

Description

The BITSET() function sets the specified bit <expN2> in a numeric value <expN1> to 1and returns the new value. 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
? bitset(x,y)
        14		&& 1110