RE: [PHP] I need a math genius!
| From: | Roedel, Mark | Date: | Mon, 12 May 2003 14:47:50 +0000 |
| Subject: | RE: [PHP] I need a math genius! | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-147306@lists.php.net to get a copy of this message | ||
Have a look at the BCMath functions...they support mathematical
operations with numbers of "any size". (In practical terms, it looks
like that probably means up to maxint digits, but I haven't looked into
the source code to verify that. (The numbers and results are actually
stored as strings rather than numeric types.
See http://www.php.net/bc for all the nitty-gritty.
---
Mark Roedel | "Blessed is he who has learned to laugh
Systems Programmer | at himself, for he shall never cease
LeTourneau University | to be entertained."
Longview, Texas, USA | -- John Powell
> -----Original Message-----
> From: Jason Caldwell [mailto:jason@thinkingman.org]
> Sent: Friday, May 09, 2003 5:47 PM
> To: php-general@lists.php.net
> Subject: [PHP] I need a math genius!
>
>
> 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)
>
> ---
>
> I'm ok at math, but not too skilled in it -- so, if the above can be
> calculated using Floating Numbers - great! -- however, if
> possible, I'd like
> to stick to unsigned integers.
>
> Thanks,
> Jason
>
>
>
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>