C# - Math.Exp() Method with Example

In this tutorial, we will learn about the C# Math.Exp() method with its definition, usage, syntax, and example. By Nidhi Last updated : March 29, 2023

C# Math.Exp() Method

The Math.Exp() method is used to get the exponent raised to the given power.

Syntax

double Math.Exp(double D);

Parameter(s)

  • D: A number specifying a power.

Return Value

It returns the e raised to the power d.

C# Example of Math.Exp() Method

The source code to demonstrate the use of Exp() method of Math class is given below. The given program is compiled and executed successfully.

using System;

class Sample {
  //Entry point of Program
  static public void Main() {
    double E = 0.0;

    E = Math.Exp(2);

    System.Console.WriteLine("EXP: " + E);
  }
}

Output

EXP: 7.38905609893065
Press any key to continue . . .

C# Math Class Programs »


Comments and Discussions!

Load comments ↻






Copyright © 2024 www.includehelp.com. All rights reserved.