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.
Kommer snart: I hele 2024 udfaser vi GitHub-problemer som feedbackmekanisme for indhold og erstatter det med et nyt feedbacksystem. Du kan få flere oplysninger under:Indsend og få vist feedback om