기술 자료

Unity Engine

Unity Engine

Exp(float)

Returns the result of raising euler's number (e) to the power power.
읽는 시간 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)); }}