Re: Stop PHP from rounding
- From: "J.O. Aho" <user@xxxxxxxxxxx>
- Date: Sun, 28 May 2006 17:56:18 +0200
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
.
- References:
- Stop PHP from rounding
- From: Jackson Scott Peebles
- Stop PHP from rounding
- Prev by Date: Stop PHP from rounding
- Next by Date: Private Area help
- Previous by thread: Stop PHP from rounding
- Next by thread: Private Area help
- Index(es):
Relevant Pages
|