Company Events Academic NI Developer Zone Support Solutions Products & Services Contact NI MyNI

nextpowerof2 (MathScript RT Module Function)

LabVIEW 2010 Help

Edition Date: June 2010

Part Number: 371361G-01

»View Product Info

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.

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