log2 函数

log2 函数

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

2位基底的对数和解析浮点数值到指数和尾数。

Syntax

语法

Y = log2(X)

[F,E] = log2(X)

Description

描述

Y = log2(X) computes the base 2 logarithm of the elements of X. 

Y=log2(X)计算X的元素以2为基底的对数。

[F,E] = log2(X) returns arrays F and E. Argument F is an array of real values, usually in the range 0.5 <= abs(F) < 1. For real X, F satisfies the equation: X = F.*2.^E. Argument E is an array of integers that, for real X, satisfy the equation: X = F.*2.^E.

[F,E]=log2(X)返回阵列FE。自变量F是一个实数的阵列,通常在区间0.5 <= abs(F) < 1。实数XF满足方程:X=F.*2.^E。自变量E是一个整数阵列,实际X,满足方程:X=F.*2.^E

Remarks

备注

This function corresponds to the ANSI C function frexp() and the IEEE floating-point standard function logb(). Any zeros in X produce F = 0 and E = 0. 

函数相当于ANSI C函数frexp()IEEE浮点标准函数logb()X中的任何零,结果F=0E=0

Examples

例如

For IEEE arithmetic, the statement [F,E] = log2(X) yields the values: 

计算IEEE运算,算式[F,E]=log2(X)得到的值:

X  F E

1  1/2 1

pi  pi/4  2

-3  -3/4 2

eps  1/2  -51

Realmax 1-eps/2 1024

realmin  1/2  -1021

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值