diff options
author | gogotanaka <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-14 17:37:38 +0000 |
---|---|---|
committer | gogotanaka <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2015-03-14 17:37:38 +0000 |
commit | 717bc13d29812b038bd37f8f405df73658e0e1a1 (patch) | |
tree | 308f9f49feb01a7c9bc4408a0bcea537d2feea99 /math.c | |
parent | 09d9d913c05a99ec972cfca4fce80ac46e6e8965 (diff) |
* math.c (math_gamma): rename NGAMMA_TABLE to NFACT_TABLE.
specify the size of the fact_table.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@49970 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'math.c')
-rw-r--r-- | math.c | 6 |
1 files changed, 3 insertions, 3 deletions
@@ -836,12 +836,12 @@ mingw_tgamma(const double d) * */ -#define NGAMMA_TABLE 23 +#define NFACT_TABLE 23 static VALUE math_gamma(VALUE obj, VALUE x) { - static const double fact_table[] = { + static const double fact_table[NFACT_TABLE] = { /* fact(0) */ 1.0, /* fact(1) */ 1.0, /* fact(2) */ 2.0, @@ -875,7 +875,7 @@ math_gamma(VALUE obj, VALUE x) if (isinf(d) && signbit(d)) domain_error("gamma"); if (d == floor(d)) { if (d < 0.0) domain_error("gamma"); - if (1.0 <= d && d <= (double)NGAMMA_TABLE) { + if (1.0 <= d && d <= (double)NFACT_TABLE) { return DBL2NUM(fact_table[(int)d - 1]); } } |