MathF.Log Method

Definition

Overloads

Log(Single)

Returns the natural (base e) logarithm of a specified number.

Log(Single, Single)

Returns the logarithm of a specified number in a specified base.

Log(Single)

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

Returns the natural (base e) logarithm of a specified number.

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

Parameters

x
Single

The number whose logarithm is to be found.

Returns

One of the values in the following table.

x parameter Return value
Positive The natural logarithm of x; that is, ln x, or log e x
Zero NegativeInfinity
Negative NaN
Equal to NaNNaN
Equal to PositiveInfinityPositiveInfinity

Remarks

Parameter x is specified as a base 10 number.

This method calls into the underlying C runtime, and the exact result or valid input range may differ between different operating systems or architectures.

See also

Applies to

Log(Single, Single)

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

Returns the logarithm of a specified number in a specified base.

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

Parameters

x
Single

The number whose logarithm is to be found.

y
Single

The base.

Returns

One of the values in the following table. (+Infinity denotes PositiveInfinity, -Infinity denotes NegativeInfinity, and NaN denotes NaN.)

xnewBase Return value
x> 0 (0 <newBase< 1) -or-(newBase> 1) lognewBase(a)
x< 0 (any value) NaN
(any value) newBase< 0 NaN
x != 1 newBase = 0 NaN
x != 1 newBase = +Infinity NaN
x = NaN (any value) NaN
(any value) newBase = NaN NaN
(any value) newBase = 1 NaN
x = 0 0 <newBase< 1 +Infinity
x = 0 newBase> 1 -Infinity
x = +Infinity 0 <newBase< 1 -Infinity
x = +Infinity newBase> 1 +Infinity
x = 1 newBase = 0 0
x = 1 newBase = +Infinity 0

Remarks

This method calls into the underlying C runtime, and the exact result or valid input range may differ between different operating systems or architectures.

Applies to