You are here: Re: Stop PHP from rounding « All PHP « IT news, forums, messages
Re: Stop PHP from rounding

Posted by J.O. Aho on 05/28/06 18:56

Jackson Scott Peebles wrote:
> Hey everyone! I'm a complete newbie to PHP, and am trying to teach
> myself how to make some scripts. So far I've done pretty good, but
> even after searching through all my books, articles, manuals, and
> search engines on PHP, I can't figure out how to stop PHP from
> rounding. I am trying to create a calculator that calculates a
> diameter * pi, and I got it, but I can't stop it from rounding to a few
> digits, which is very annoying. I'm looking at calculating like ten
> thousand digits and printing all of them (I know this doesn't sound
> convenient, but it will not be used for public use, just for some
> clients of mine that say they want accuracy).

PHP ain't a language made for high precision calculations, if you need a
bigger precision, use an external tool written in C++ or any other good
language which returns you the value, you can then call the program with
exec() and then use the returned string.


//Aho

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация