math constants

The general naming scheme is M_. In cases where the constant is a ratio (x/y), the name is M_X_Y, and in cases where there is an operation on a number, the name is M_OPERNUM (for example, M_SQRT2).

Mathematical Constants
Constant Description
M_PI_2 pi/2
M_PI_4 pi/4
M_1_PI 1/pi
M_2_PI 2/pi
M_2_SQRTPI 2/sqrt(pi)
M_E the constant e
M_SQRT2 sqrt(2)
M_SQRT1_2 1/sqrt(2)
M_LOG2E log base 2 of e
M_LOG10E log base 10 of e
M_LN2 log base e of 2
M_LN10 log base e of 10

About samehramzylabib

See About on
This entry was posted in Coding, PHP Constants, PHP Math and tagged . Bookmark the permalink.


Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s