summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authorgogotanaka <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-14 17:37:38 (GMT)
committergogotanaka <gogotanaka@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2015-03-14 17:37:38 (GMT)
commit717bc13d29812b038bd37f8f405df73658e0e1a1 (patch)
tree308f9f49feb01a7c9bc4408a0bcea537d2feea99 /math.c
parent09d9d913c05a99ec972cfca4fce80ac46e6e8965 (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.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/math.c b/math.c
index b4cdeef..011581a 100644
--- a/math.c
+++ b/math.c
@@ -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]);
}
}