Re: factorial and exponent
- From: Flash Gordon <spam@xxxxxxxxxxxxxxxxxx>
- Date: Sun, 17 Jun 2007 10:30:45 +0100
Army1987 wrote, On 17/06/07 09:48:
"Richard Heathfield" <rjh@xxxxxxxxxxxxxxx> ha scritto nel messaggio news:Gv6dnQ2-P8SDeunbnZ2dnUVZ8t_inZ2d@xxxxxxxxxBiGYaN said:
On Jun 16, 5:02 pm, Thomas <mynameisthomasander...@xxxxxxxxx> wrote:Nonsense.I want to calculate the value of 126 raise to the power 126 in turboUse GMP library found in http://gmplib.org/
C.
I've checked it with unsigned long int but it doesn't help.
So how could one calculate the value of such big numbers?
What's the technique?
It will enable you to do "Arithmetic without Limitations" !!
Consider an integer greater than or equal to 2. Call it A. Consider
another integer greater than or equal to 2. Call it B.
Raise A to the power B, storing the result in A. Now raise B to the
power A, storing the result in B. If you repeat this often enough, you
*will* hit a limit, no matter what numerical library you use.
But it is a limit of your computer, not of the library itself.
If it uses space allocated with malloc/realloc, then the library (rather than the computer) has a limit because even with an infinite computer size_t and pointers are of defined finite size, so you can only have a block of known finite size and you can only chain a finite number of such blocks together with pointers.
Of course, this applies to all libraries written in C.
It is also very important for people learning to be programmers (or who already are programmers) to understand that in the real world resources are always limited, so there is no such thing as "without limitations".
--
Flash Gordon
.
- References:
- factorial and exponent
- From: Thomas
- Re: factorial and exponent
- From: BiGYaN
- Re: factorial and exponent
- From: Richard Heathfield
- Re: factorial and exponent
- From: Army1987
- factorial and exponent
- Prev by Date: Re: Pointer Ambiguity
- Next by Date: Re: Pointer Ambiguity
- Previous by thread: Re: factorial and exponent
- Next by thread: Re: factorial and exponent
- Index(es):
Relevant Pages
|