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

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


 

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