Re: Stop PHP from rounding



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
.



Relevant Pages

  • Web based IDE?
    ... I have been doing quite some php using UltraEdit and Eclipse. ... searching capabilities of a good IDE: ...
    (comp.lang.php)
  • Re: The "Who the @@#$%&^@ is responsible for quality control" msg.
    ... Jean-Yves did work for HPQ ... Such as asking question about who I was, ... "no" answer but instead got advice on searching for information about ... and involvement with HP calculator development in the past? ...
    (comp.sys.hp48)
  • Re: how to avoid firefox autofill on refresh
    ... I have been searching the net, and just can't seem to find a solution. ... My problem is that I have a form (a kind of calculator) and I would ... when you refresh a page. ... I know you can deactivate the function in the options BUT I can't ...
    (alt.html)
  • RE: [PHP] datediff in php
    ... Does anyone know if there is a date difference function in php? ... Much like DATEDIFF in ms sql. ... Going to http://www.php.net/date and searching the page for datediff ... seconds cause of all the loops. ...
    (php.general)
  • Re: [PHP] Screenshot from web page
    ... Actually I understood that I was searching not real thing. ... I needed PHP code that will generate jpeg from HTML. ... This will put the screenshot on to the ...
    (php.general)