상수 PI

PI
PI()
M_PI
Math.PI

1 Bash[ | ]

Bash
Copy
PI=3.1415926535898
echo "Pi is approximately $PI"
# Pi is approximately 3.1415926535898

2 C#[ | ]

C#
Copy
Console.WriteLine("Pi is approximately "+Math.PI);
Console.WriteLine("E is approximately "+Math.E);
C#
Copy
Console.WriteLine("Pi is approximately {0}", Math.PI);
Console.WriteLine("E is approximately {0}", Math.E);
//Pi is approximately 3.14159265358979
//E is approximately 2.71828182845905

3 Excel[ | ]

PHP
Copy
=PI()
// 3.141592654

4 Java[ | ]

Java
Copy
System.out.println("Pi is approximately "+Math.PI);
System.out.println("E is approximately "+Math.E);

5 PHP[ | ]

PHP
Copy
var_dump( pi() ); # float(3.141592653589793)
var_dump( M_PI ); # float(3.141592653589793)
Loading

6 PowerShell[ | ]

powershell
Copy
[math]::pi
# 3.14159265358979

7 Python[ | ]

Python
Copy
import math
print("Pi is approximately %s" % math.pi)
print("E is approximately %s" % math.e)
Loading

8 R[ | ]

R
Copy
print( pi ) ## [1] 3.141593
Loading

9 Ruby[ | ]

Ruby
Copy
puts("Pi is approximately %s" % Math::PI) # Pi is approximately 3.141592653589793
puts("E is approximately %s" % Math::E) # E is approximately 2.718281828459045
Loading

10 SQL[ | ]

10.1 MySQL[ | ]

MySQL
Copy
SELECT PI();
# 3.141593

11 같이 보기[ | ]