From 9:00 AM - 12:00 PM CDT on Saturday, June 6th, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

# bitshift (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

d = bitshift(a, b)

d = bitshift(a, b, c)

## Description

Performs a bitwise shift on the input elements. For example, if a = 9 (1001), bitshift(a, 1) = 18 (10010) and bitshift(a, 1, 4) = 2 (0010).

Examples

## Inputs

Name Description
a Specifies a scalar, vector, or matrix of nonnegative integers. All elements of a must be less than maxfloatint.
b Determines the shift sizes. Shifting a by b bits is equivalent to multiplying a by 2^b and then rounding to the nearest integer. b is a scalar, vector, or matrix of integers. b is the same size as a unless a or b is a scalar.
c Specifies the number of valid bits for each of the shifted integers. If the shifted integers exceed c bits, LabVIEW ignores the overflow. c is a matrix of integers. The default is 53.

## Outputs

Name Description
d Returns the elements of a shifted to the left by b bits. d is a matrix of the same size as the larger of a and b.

## 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 = [134, 45, 232]
B = [1, 2, 3]
D = bitshift(A, B)