factorial() is the only function which uses fakul_table[] array, so move
it into that function in order to avoid possible static initialization
order problems.
// Fakultät (! n), wo n Fixnum >=0 ist. Ergebnis Integer.
extern const cl_I factorial (uintL n);
-//CL_REQUIRE(cl_I_factorial)
// Double factorial (!! n), with n Fixnum >=0. Returns integer.
extern const cl_I doublefactorial (uintL n);
// General includes.
#include "cl_sysdep.h"
-CL_PROVIDE(cl_I_factorial)
-
// Specification.
#include "cln/integer.h"
// vermeidet, daß oft große Zahlen mit ganz kleinen Zahlen multipliziert
// werden.
-static uintV const fakul_table [] = {
+const cl_I factorial (uintL n) // assume n >= 0 small
+{
+ static uintV const fakul_table [] = {
1,
1UL,
1UL*2,
#endif
#endif
#endif
-};
+ };
-const cl_I factorial (uintL n) // assume n >= 0 small
-{
if (n < sizeof(fakul_table)/sizeof(cl_I))
{ return UV_to_I(fakul_table[n]); }
else
} // namespace cln
-CL_PROVIDE_END(cl_I_factorial)