Log10(float)
Returns the base 10 logarithm of a specified number.
Read time 1 minuteLast updated 4 days ago
Definition
- Type: Method
- Namespace: UnityEngine
- Assembly: UnityEngine.CoreModule
public static float Log10(float f)
Parameters
Value to compute the logarithm for.
Returns
Type | Description |
|---|---|
| float | Result of the logarithm operation. |
Remarks
Computing the base-10 logarithm of is the inverse operation to raising 10 to the power of the output of this function. This means that 'Mathf.Pow(10, x) = f', with x being the output of this function.
fAdditional Resources: Mathf.Pow.
Examples
using UnityEngine;public class Example : MonoBehaviour{ void Start() { // logarithm of 100 in base 10 // Prints 2 print(Mathf.Log10(100)); }}