C# Math - E Field
The C# E field is used to return the value of e to the available precision. It returns the value of e as 2.7182818284590451.
Syntax
public const double E = 2.7182818284590451;
Parameters
No parameter is required.
Return Value
Returns the value of e to the available precision.
Example:
In the example below, Math.E constant is used to return the value of e to the available precision.
using System; class MyProgram { static void Main(string[] args) { double e = Math.E; Console.WriteLine("Math.E = " + e); Console.WriteLine("Math.Log(Math.E) = " + Math.Log(e)); Console.WriteLine("Math.Log10(Math.E) = " + Math.Log10(e)); } }
The output of the above code will be:
Math.E = 2.71828182845905 Math.Log(Math.E) = 1 Math.Log10(Math.E) = 0.434294481903252
❮ C# Math Methods