From 7:00 PM CST Friday, January 24th - 7:00 PM CST Sunday, January 26th, ni.com will be undergoing system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

nextpowerof2 (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: basic

Requires: MathScript RT Module

Syntax

c = nextpowerof2(a)

Legacy Name: nextpow2

Description

Computes the first power of 2 that is not smaller than abs(a). More precisely, p = nextpowerof2(a) if 2^p>=abs(a) and p is minimal.

Examples

Inputs

Name Description
a Specifies a scalar, vector, or matrix of double-precision, floating-point or complex double-precision, floating-point numbers. If a is a vector, nextpowerof2(a) is equivalent to nextpowerof2(length(a)).

Outputs

Name Description
c Returns the first power of 2 that is not smaller than abs(a). c is a scalar.

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 Yes

Examples

A = 7.3
C = nextpowerof2(A)

Related Topics

log2
powerof2

WAS THIS ARTICLE HELPFUL?

Not Helpful