Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

bitset (MathScript Function) (Windows, Not in Base Package)

LabVIEW 8.5 Help
August 2007

NI Part Number:
371361D-01

»View Product Info

Member of the bitwise class.

Syntax

c = bitset(a, b)

c = bitset(a, b, d)

Description

Sets the value of a bit at a particular position in a number. For example, if a = 5 (101), bitset(a, 4) = 13 (1101).

Examples

Inputs

Name Description
a Specifies a positive integer. a must be less than bitmax.
b Specifies the position of the bit whose value you want to set. b is an integer.
d Specifies the value to which you want to set the bit at position b. d must be 0 or 1. The default is 1.

Outputs

Name Description
c Returns a with the bit in position b set to d.

Examples

A = 2340
C = bitset(A, 1)

Related Topics

bitcmp
bitget
bitmax
bitor
bitshift
bitxor


Resources


 

Your Feedback! poor Poor  |  Excellent excellent   Yes No
 Document Quality? 
 Answered Your Question? 
Add Comments 1 2 3 4 5 submit