MathF.Log Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
Log(Single) |
Returns the natural (base |
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 NaN | NaN |
Equal to PositiveInfinity | PositiveInfinity |
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.)
x | newBase | 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
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for