# MathF.Log 方法

## 重载

 Log(Single, Single) 返回指定数字在使用指定底时的对数。Returns the logarithm of a specified number in a specified base. Log(Single) 返回指定数字的自然对数（底为 `e`）。Returns the natural (base `e`) logarithm of a specified number.

## Log(Single, Single)

``````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

#### 返回

`x``newBase` 返回值Return value
`x`> 0`x`> 0 (0 <`newBase`< 1) 或 (`newBase`> 1)(0 <`newBase`< 1) -or-(`newBase`> 1) lognewBase(a)lognewBase(a)
`x`< 0`x`< 0 （任意值）(any value) NaNNaN
（任意值）(any value) `newBase`< 0`newBase`< 0 NaNNaN
`x` != 1`x` != 1 `newBase` = 0`newBase` = 0 NaNNaN
`x` != 1`x` != 1 `newBase` = +Infinity`newBase` = +Infinity NaNNaN
`x` = NaN`x` = NaN （任意值）(any value) NaNNaN
（任意值）(any value) `newBase` = NaN`newBase` = NaN NaNNaN
（任意值）(any value) `newBase` = 1`newBase` = 1 NaNNaN
`x` = 0`x` = 0 0 <`newBase`< 10 <`newBase`< 1 +Infinity+Infinity
`x` = 0`x` = 0 `newBase`> 1`newBase`> 1 -Infinity-Infinity
`x` = +Infinity`x` = +Infinity 0 <`newBase`< 10 <`newBase`< 1 -Infinity-Infinity
`x` = +Infinity`x` = +Infinity `newBase`> 1`newBase`> 1 +Infinity+Infinity
`x` = 1`x` = 1 `newBase` = 0`newBase` = 0 00
`x` = 1`x` = 1 `newBase` = +Infinity`newBase` = +Infinity 00

## Log(Single)

``````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` parameter 返回值Return value
Positive `x` 的自然对数，即 ln `x` 或 log e `x`The natural logarithm of `x`; that is, ln `x`, or log e `x`
Zero NegativeInfinity

Equal to PositiveInfinityPositiveInfinity