Re: I need a math genius!
| From: | Pablo | Date: | Sat, 10 May 2003 01:52:23 +0000 |
| Subject: | Re: I need a math genius! | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-147085@lists.php.net to get a copy of this message | ||
On 05/09/2003 5:46 PM, Jason Caldwell (jason@thinkingman.org) wrote:
> Hi
>
> I need to divide, subtract and add *very* large unsigned integer numbers --
> no floating point numbers. In PHP I'm limited to an integer no larger than:
> 2,147,483,647 ...
>
> How is it possible to calculate much, much larger numbers?
>
> For example, say I want to add the following number:
>
> (7827363524473290039928827730299288277102938474655367299188272630 +
> 7829817981291982837938719793747646199192739190198791238479832)
Do you require a PHP-only solution? Or do you just want the result? If the
latter, and you have access to a *nix box with dc you can perform the
calculation:
# dc
7827363524473290039928827730299288277102938474655367299188272630
7829817981291982837938719793747646199192739190198791238479832
+
p
7835193342454582022766766450093035923302131213845566090426752462
Pablo