ドキュメント

Unity Engine

Unity Engine

Exp(float)

Returns the result of raising euler's number (e) to the power power.
読み終わるまでの所要時間 1 分最終更新 1ヶ月前

Definition

  • Type: Method
  • Namespace: UnityEngine
  • Assembly: UnityEngine.CoreModule
public static float Exp(float power)

Parameters

power

Exponent of the exponentiation operation.

Returns

Type

Description

floatResult of the exponentiation operation.

Remarks

The result of this function is the same as the result of 'Mathf.Pow(e, power)', with e being Euler's number (2.718282).
Additional Resources: Mathf.Pow.

Examples

using UnityEngine;public class Example : MonoBehaviour{ void Start() { // Prints Infinity Debug.Log(Mathf.Exp(Mathf.Infinity)); // Prints 2.718282 Debug.Log(Mathf.Exp(1)); // Prints 1 Debug.Log(Mathf.Exp(0)); // Prints 0 Debug.Log(Mathf.Exp(-Mathf.Infinity)); }}