|
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]
|