# Log

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

## Definition

* **Type:** Method
* **Namespace:** [UnityEngine](/engine/6000.0/script-reference/unityengine.md)
* **Assembly:** UnityEngine.CoreModule

## Log(float, float)

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

```csharp
public static float Log(float f, float p)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)): **** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)):&#x20;

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Examples

```csharp
using UnityEngine;

public class ScriptExample : MonoBehaviour
{
    void Start()
    {
        // logarithm of 6 in base 2
        // prints 2.584963
        Debug.Log(Mathf.Log(6, 2));
    }
}
```

## Log(float)

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

```csharp
public static float Log(float f)
```

### Parameters

**** (\[float]\(https\://learn.microsoft.com/dotnet/api/system.single)):&#x20;

### Returns

| Type                                                          | Description |
| ------------------------------------------------------------- | ----------- |
| [float](https://learn.microsoft.com/dotnet/api/system.single) |             |

### Examples

```csharp
using UnityEngine;

public class ScriptExample : MonoBehaviour
{
    void Start()
    {
        // natural logarithm of 100
        // prints 4.60517
        Debug.Log(Mathf.Log(100));
    }
}
```
