MATLAB Function Reference
  Go to function:
    Search    Help Desk 
pow2    Examples   See Also

Base 2 power and scale floating-point numbers

Syntax

Description

X = pow2(Y) returns an array X whose elements are 2 raised to the power Y.

X = pow2(F,E) computes for corresponding elements of F and E.The result is computed quickly by simply adding E to the floating-point exponent of F. Arguments F and E are real and integer arrays, respectively.

Remarks

This function corresponds to the ANSI C function ldexp() and the IEEE floating-point standard function scalbn().

Examples

For IEEE arithmetic, the statement X = pow2(F,E) yields the values:

See Also

log2        Base 2 logarithm and dissect floating-point numbers into exponent and mantissa

^           Matrix power

.^          Array power

exp         Exponential

hex2num     Hexadecimal to double number conversion

realmax     Largest positive floating-point number

realmin     Smallest positive floating-point number



[ Previous | Help Desk | Next ]