Company Events Academic Community Support Solutions Products & Services Contact NI MyNI

bitset (MathScript RT Module Function)

LabVIEW 2012 MathScript RT Module Help

Edition Date: June 2012

Part Number: 373123C-01

»View Product Info
Download Help (Windows Only)

Owning Class: bitwise

Requires: MathScript RT Module

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 maxfloatint.
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.

Details

The following table lists the support characteristics of this function.

Supported in the LabVIEW Run-Time Engine Yes
Supported on RT targets Yes
Suitable for bounded execution times on RT Not characterized

Examples

A = 2340
C = bitset(A, 1)

Related Topics

bitget
bitnot
bitor
bitshift
bitxor
maxfloatint


 

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