Contact
CoCalc Logo Icon
StoreFeaturesDocsShareSupport News AboutSign UpSign In
| Download

All published worksheets from http://sagenb.org

Views: 168703
Image: ubuntu2004

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

Interestingly, it is difficult to break the exponential function.

exp(1000)*1.0
e^1000
exp(1000)*1.01
1.01000000000000*e^1000
exp(log(exp(1000),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

Finally,

1/factorial(200)
1/788657867364790503552363213932185062295135977687173263294742533244359449963403342920304284011984623904177212138919638830257642790242637105061926624952829931113462857270763317237396988943922445621451664240254033291864131227428294853277524242407573903240321257405579568660226031904170324062351700858796178922222789623703897374720000000000000000000000000000000000000000000000000