[OS X TeX] TeX request

Justin C. Walker justin at mac.com
Thu Jun 23 22:57:08 CEST 2005


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
788657867364790503552363213932185062295135977687173263294742533244359449 
963403342920304284011984623904177212138919638830257642790242637105061926 
624952829931113462857270763317237396988943922445621451664240254033291864 
131227428294853277524242407573903240321257405579568660226031904170324062 
351700858796178922222789623703897374720000000000000000000000000000000000 
000000000000000


>> 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>





More information about the macostex-archives mailing list