MathF.Log 方法

定义

重载

Log(Single)

返回指定数字的自然对数(底为 e)。

Log(Single, Single)

返回指定数字在使用指定底时的对数。

Log(Single)

Source:
MathF.cs
Source:
MathF.cs
Source:
MathF.cs

返回指定数字的自然对数(底为 e)。

public:
 static float Log(float x);
public static float Log (float x);
static member Log : single -> single
Public Shared Function Log (x As Single) As Single

参数

x
Single

要查找其对数的数字。

返回

下表中的值之一。

x 参数 返回值
x 的自然对数,即 ln x 或 log e x
NegativeInfinity
负数NaN
等于 NaNNaN
等于 PositiveInfinityPositiveInfinity

注解

参数 x 指定为基数 10。

此方法调用基础 C 运行时,不同的操作系统或体系结构之间的确切结果或有效输入范围可能会有所不同。

另请参阅

适用于

Log(Single, Single)

Source:
MathF.cs
Source:
MathF.cs
Source:
MathF.cs

返回指定数字在使用指定底时的对数。

public:
 static float Log(float x, float y);
public static float Log (float x, float y);
static member Log : single * single -> single
Public Shared Function Log (x As Single, y As Single) As Single

参数

x
Single

要查找其对数的数字。

y
Single

基数。

返回

下表中的值之一。 (+Infinity 表示 PositiveInfinity,-Infinity 表示 NegativeInfinity,NaN 表示 NaN。)

xnewBase 返回值
x> 0 (0 <newBase< 1) 或 (newBase> 1) lognewBase(a)
x< 0 (任意值) NaN
(任意值)newBase< 0 NaN
x != 1newBase = 0 NaN
x != 1newBase = +Infinity NaN
x = NaN (任意值) NaN
(任意值)newBase = NaN NaN
(任意值)newBase = 1 NaN
x = 0 0 <newBase< 1 +Infinity
x = 0newBase> 1 -Infinity
x = +Infinity 0 <newBase< 1 -Infinity
x = +InfinitynewBase> 1 +Infinity
x = 1newBase = 0 0
x = 1newBase = +Infinity 0

注解

此方法调用基础 C 运行时,不同的操作系统或体系结构之间的确切结果或有效输入范围可能会有所不同。

适用于