ViewVC Help
View File | Revision Log | Show Annotations | View Changeset | Root Listing
root/OpenMD/branches/development/src/math/Factorials.hpp
Revision: 1719
Committed: Thu May 24 01:32:38 2012 UTC (12 years, 11 months ago) by gezelter
File size: 5141 byte(s)
Log Message:
Forgot the factorials!

File Contents

# User Rev Content
1 gezelter 1719 /***************************************************************************
2     * This program is free software; you can redistribute it and/or modify *
3     * it under the terms of the GNU General Public License as published by *
4     * the Free Software Foundation; either version 3 of the License, or *
5     * (at your option) any later version. *
6     * *
7     * This program is distributed in the hope that it will be useful, *
8     * but WITHOUT ANY WARRANTY; without even the implied warranty of *
9     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
10     * GNU General Public License for more details. *
11     * *
12     * You should have received a copy of the GNU General Public License *
13     * along with this program; if not, see <http://www.gnu.org/licenses/>. *
14     ***************************************************************************/
15     #include "config.h"
16     const int maxFact = 151; // Largest factorial computed
17     const RealType fact[maxFact] =
18     {
19     1.0,
20     1.0,
21     2.0,
22     6.0,
23     24.0,
24     120.0,
25     720.0,
26     5040.0,
27     40320.0,
28     362880.0,
29     3628800.0,
30     39916800.0,
31     479001600.0,
32     6227020800.0,
33     87178291200.0,
34     1307674368000.0,
35     20922789888000.0,
36     355687428096000.0,
37     6402373705728000.0,
38     1.21645100408832e17,
39     2.43290200817664e18,
40     5.109094217170944e19,
41     1.1240007277776077e21,
42     2.5852016738884978e22,
43     6.2044840173323941e23,
44     1.5511210043330986e25,
45     4.0329146112660565e26,
46     1.0888869450418352e28,
47     3.0488834461171384e29,
48     8.8417619937397008e30,
49     2.6525285981219103e32,
50     8.2228386541779224e33,
51     2.6313083693369352e35,
52     8.6833176188118859e36,
53     2.9523279903960412e38,
54     1.0333147966386144e40,
55     3.7199332678990118e41,
56     1.3763753091226343e43,
57     5.2302261746660104e44,
58     2.0397882081197442e46,
59     8.1591528324789768e47,
60     3.3452526613163803e49,
61     1.4050061177528798e51,
62     6.0415263063373834e52,
63     2.6582715747884485e54,
64     1.1962222086548019e56,
65     5.5026221598120885e57,
66     2.5862324151116818e59,
67     1.2413915592536073e61,
68     6.0828186403426752e62,
69     3.0414093201713376e64,
70     1.5511187532873822e66,
71     8.0658175170943877e67,
72     4.2748832840600255e69,
73     2.3084369733924138e71,
74     1.2696403353658276e73,
75     7.1099858780486348e74,
76     4.0526919504877221e76,
77     2.3505613312828789e78,
78     1.3868311854568986e80,
79     8.3209871127413916e81,
80     5.0758021387722484e83,
81     3.1469973260387939e85,
82     1.9826083154044401e87,
83     1.2688693218588417e89,
84     8.2476505920824715e90,
85     5.4434493907744307e92,
86     3.6471110918188683e94,
87     2.4800355424368305e96,
88     1.711224524281413e98,
89     1.197857166996989e100,
90     8.5047858856786218e101,
91     6.1234458376886077e103,
92     4.4701154615126834e105,
93     3.3078854415193856e107,
94     2.4809140811395391e109,
95     1.8854947016660498e111,
96     1.4518309202828584e113,
97     1.1324281178206295e115,
98     8.9461821307829729e116,
99     7.1569457046263779e118,
100     5.7971260207473655e120,
101     4.7536433370128398e122,
102     3.9455239697206569e124,
103     3.314240134565352e126,
104     2.8171041143805494e128,
105     2.4227095383672724e130,
106     2.1077572983795269e132,
107     1.8548264225739836e134,
108     1.6507955160908452e136,
109     1.4857159644817607e138,
110     1.3520015276784023e140,
111     1.24384140546413e142,
112     1.1567725070816409e144,
113     1.0873661566567424e146,
114     1.0329978488239052e148,
115     9.916779348709491e149,
116     9.6192759682482062e151,
117     9.426890448883242e153,
118     9.3326215443944096e155,
119     9.3326215443944102e157,
120     9.4259477598383536e159,
121     9.6144667150351211e161,
122     9.9029007164861754e163,
123     1.0299016745145622e166,
124     1.0813967582402903e168,
125     1.1462805637347078e170,
126     1.2265202031961373e172,
127     1.3246418194518284e174,
128     1.4438595832024928e176,
129     1.5882455415227421e178,
130     1.7629525510902437e180,
131     1.9745068572210728e182,
132     2.2311927486598123e184,
133     2.5435597334721862e186,
134     2.9250936934930141e188,
135     3.3931086844518965e190,
136     3.969937160808719e192,
137     4.6845258497542883e194,
138     5.5745857612076033e196,
139     6.6895029134491239e198,
140     8.09429852527344e200,
141     9.8750442008335976e202,
142     1.2146304367025325e205,
143     1.5061417415111404e207,
144     1.8826771768889254e209,
145     2.3721732428800459e211,
146     3.0126600184576582e213,
147     3.8562048236258025e215,
148     4.9745042224772855e217,
149     6.4668554892204716e219,
150     8.4715806908788174e221,
151     1.1182486511960039e224,
152     1.4872707060906852e226,
153     1.9929427461615181e228,
154     2.6904727073180495e230,
155     3.6590428819525472e232,
156     5.0128887482749898e234,
157     6.9177864726194859e236,
158     9.6157231969410859e238,
159     1.346201247571752e241,
160     1.8981437590761701e243,
161     2.6953641378881614e245,
162     3.8543707171800706e247,
163     5.5502938327393013e249,
164     8.0479260574719866e251,
165     1.1749972043909099e254,
166     1.7272458904546376e256,
167     2.5563239178728637e258,
168     3.8089226376305671e260,
169     5.7133839564458505e262
170     }; // array of precomputed factorials

Properties

Name Value
svn:eol-style native