2 04, 2009

pi

By | 2009-04-01T16:04:36+00:00 April 2nd, 2009|Categories: PHP, Ruby|Tags: , , |Comments Off on pi

Returns the value of PI to 14 (default) decimal places. This precision can be altered in the php.ini file.

PHP

echo pi();
// => 3.1415926535898

Ruby

puts Math::PI;
# => 3.14159265358979

In the code above, PI is actually a constant of the Module Math. PHP also has a constant which stores the approximate value of PI – M_PI.

PHP

echo M_PI();
// => 3.1415926535898

This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.

This Is A Custom Widget

This Sliding Bar can be switched on or off in theme options, and can take any widget you throw at it or even fill it with your custom HTML Code. Its perfect for grabbing the attention of your viewers. Choose between 1, 2, 3 or 4 columns, set the background color, widget divider color, activate transparency, a top border or fully disable it on desktop and mobile.