sage04

699 days ago by jozefl

Recall that when factorials larger than 170! and powers of e larger than e^709 are input into Matlab, matlab returns Inf, its abbreviation for infinity. Try changing the factorial below, but be careful: calculation times for factorials increase very quickly.

factorial(200) 
       
788657867364790503552363213932185062295135977687173263294742533244359449\
963403342920304284011984623904177212138919638830257642790242637105061926\
624952829931113462857270763317237396988943922445621451664240254033291864\
131227428294853277524242407573903240321257405579568660226031904170324062\
351700858796178922222789623703897374720000000000000000000000000000000000\
000000000000000
788657867364790503552363213932185062295135977687173263294742533244359449963403342920304284011984623904177212138919638830257642790242637105061926624952829931113462857270763317237396988943922445621451664240254033291864131227428294853277524242407573903240321257405579568660226031904170324062351700858796178922222789623703897374720000000000000000000000000000000000000000000000000

Interestingly, it is difficult to break the exponential function.

exp(1000)*1.0 
       
e^1000
e^1000
exp(1000)*1.01 
       
1.01000000000000*e^1000
1.01000000000000*e^1000
exp(log(exp(1000),10)) 
       
e^(1000/log(10))
e^(1000/log(10))

We have to resort to our RielField function to obtain a numerical aproximation.

R=RealField(100) R(exp(1000)) 
       
1.9700711140170469938888793522e434
1.9700711140170469938888793522e434

Finally,

1/factorial(200) 
       
1/7886578673647905035523632139321850622951359776871732632947425332443594\
499634033429203042840119846239041772121389196388302576427902426371050619\
266249528299311134628572707633172373969889439224456214516642402540332918\
641312274282948532775242424075739032403212574055795686602260319041703240\
623517008587961789222227896237038973747200000000000000000000000000000000\
00000000000000000
1/788657867364790503552363213932185062295135977687173263294742533244359449963403342920304284011984623904177212138919638830257642790242637105061926624952829931113462857270763317237396988943922445621451664240254033291864131227428294853277524242407573903240321257405579568660226031904170324062351700858796178922222789623703897374720000000000000000000000000000000000000000000000000