pow2函数
Base 2 power and scale floating-point numbers
以2为基底的幂函数。
Syntax
语法
X = pow2(Y)
X = pow2(F,E)
Description
描述
X = pow2(Y) returns an array X whose elements are 2 raised to the power Y.
X=pow2(Y)返回一个X阵列其元素是以2为基底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.
X=pow2(F,E)计算,F和E的相应元素。结果计算很快,添加简单的E用来计算幂指数,再乘F。变量F和E分别是实数并是整数阵列。
Remarks
备注
This function corresponds to the ANSI C function ldexp() and the IEEE floating-point standard function scalbn().
这个函数对应的ANSI C函数 1dexp()和IEEE浮点标准函数scalbn()。
Examples
例如:
For IEEE arithmetic, the statement X = pow2(F,E) yields the values:
IEEE运算,语句X=pow2(F,E)服从于值:
F E X
1/2 1 1
pi/4 2 pi
-3/4 2 -3
1/2 -51 eps
1-eps/2 1024 realmax
1/2 -1021 realmin