Scale By Power Of 2 Function

Owning Palette: Numeric VIs and Functions

Requires: Base Development System

Multiplies x by 2 raised to the power of n.

If x is an integer or fixed-point number, this function is the equivalent of an arithmetic shift. The connector pane displays the default data types for this polymorphic function.

Details  Example

 Add to the block diagram  Find on the palette
n can be a scalar number, array or cluster of numbers, array of clusters of numbers, and so on. If n is a floating-point number, this function rounds n before it scales x (0.5 rounds to 0; 0.51 rounds to 1). If n is a 64-bit integer, LabVIEW coerces n to a 32-bit integer.
x can be a scalar number, array or cluster of numbers, array of clusters of numbers, and so on.
x*2^n is the result of multiplying x by 2, raised to the power of n.

Scale By Power Of 2 Details

If you wire a fixed-point value to this function, the resulting output value retains the fixed-point configuration settings of the input value. However, the value is likely to truncate or wrap.

Example

Refer to the Numeric Functions VI in the labview\examples\Numerics directory for an example of using the Scale By Power Of 2 function.

 Open example  Find related examples