[OS X TeX] TeX request

Bertrand Crettez bertrand.crettez at wanadoo.fr
Fri Jun 24 07:58:00 CEST 2005


Le 23 juin 05 à 22:57, Justin C. Walker a écrit :

>
> On Jun 23, 2005, at 13:41 , Chris Goedde wrote:
>
>> On Jun 23, 2005, at 3:24 PM, Gerben Wierda wrote:
>>
>>> Hello folks,
>>>
>>> I need help with a trick I want to perform. I want to be able to  
>>> display all the digits of
>>>
>>> 2!
>>> 10!
>>> 200!
>>>
>>
>> Do you really need 200!?
>>
>> A little googling turned up http://www.cs.umd.edu/Outreach/ 
>> hsContest97/questions/node3.html which might provide a solution. I  
>> don't know if it will work for you, since their code may only work  
>> if the answer has fewer than 100 digits. (I'm also not sure what  
>> language it's written in.)
>>
>
> The language is Pascal; the 100-digit limit is a program limitation  
> (the size of an array).
>
> Maybe something like Ruby is useful, if you (Gerben) want to  
> compute some function that will spit out potentially large numbers  
> of digits.
>
> e.g:
>
> $ cat foo.rb
> def fact(n) if n == 1 then 1 else n*fact(n-1) end end
> print fact(200), "\n"
> $ ruby  foo.rb
> 7886578673647905035523632139321850622951359776871732632947425332443594 
> 4996340334292030428401198462390417721213891963883025764279024263710506 
> 1926624952829931113462857270763317237396988943922445621451664240254033 
> 2918641312274282948532775242424075739032403212574055795686602260319041 
> 7032406235170085879617892222278962370389737472000000000000000000000000 
> 0000000000000000000000000
>
>
>
>>> I think that 200! has close to 400 digits in the answer, if my  
>>> back-of-the-envelope answer is correct.
>>>
>
> That's 375 :-}
>
> Cheers,
>
> Justin
>
> --
> Justin C. Walker, Curmudgeon-At-Large
> Institute for General Semantics
> --------
> If you're not confused,
> You're not paying attention
> --------
>
>
> --------------------- Info ---------------------
> Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
>           & FAQ: http://latex.yauh.de/faq/
> TeX FAQ: http://www.tex.ac.uk/faq
> List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>
>
>
>
>


--------------------- Info ---------------------
Mac-TeX Website: http://www.esm.psu.edu/mac-tex/
           & FAQ: http://latex.yauh.de/faq/
TeX FAQ: http://www.tex.ac.uk/faq
List Post: <mailto:MacOSX-TeX at email.esm.psu.edu>





More information about the macostex-archives mailing list