C# Math PI

Description

Math PI represents the ratio of the circumference of a circle to its diameter, specified by the constant, PI.

Syntax

Math.PI has the following syntax.


public const double PI

Example

The following code shows how to use Math.PI.


using System;//ww w.ja  v a2  s.  com

public class MainClass{
  public static void Main(String[] argv){  

    
    System.Console.WriteLine(2*Math.PI);

  }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System »




Array
BitConverter
Boolean
Byte
Char
Console
ConsoleKeyInfo
Convert
DateTime
DateTimeOffset
Decimal
Double
Enum
Environment
Exception
Guid
Int16
Int32
Int64
Math
OperatingSystem
Random
SByte
Single
String
StringComparer
TimeSpan
TimeZone
TimeZoneInfo
Tuple
Tuple
Tuple
Type
UInt16
UInt32
UInt64
Uri
Version