1. Computing

Discuss in my forum

Angela Bradley

A Slice of Pi

By , About.com GuideNovember 12, 2007

Follow me on:

When I was a kid, I thought it was incredibly cool that I could recite Pi to something like 50 decimal places off the top of my head. I now think it is considerably less cool, and the last time I tried I barely made it to 20 places. Remembering this made me wonder... how many decimal places does PHP use when working with Pi? Well, by default, PHP will use Pi to 14 decimals. If that isn't to your liking, you can change the PHP.INI file to set it lower or as high as 20 decimal places.
Comments
November 22, 2007 at 10:05 am
(1) Unknown says:

Found the following PHP code which calculates PI to as many places as you want:
http://www.planet-source-code.com/vb/scripts/ShowCode.asp?lngWId=8&txtCodeId=2195

Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>
Top Related Searches slice of pi

©2013 About.com. All rights reserved.