summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
authorS.H <gamelinks007@gmail.com>2021-08-18 02:25:19 +0900
committerGitHub <noreply@github.com>2021-08-18 02:25:19 +0900
commit58bd9434360d5a46974eaa03139893c0145615dc (patch)
tree9ed044f8c37e0dfbdf54d0f784b85031bce57dd6 /math.c
parent6a9bfa4d9387b9d8f07f43f4546437be57f9e27c (diff)
Replace f_boolcast with RBOOL macro
* Move f_boolcast definination * Remove f_boolcast macro defination * to
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/4748 Merged-By: nobu <nobu@ruby-lang.org>
Diffstat (limited to 'math.c')
-rw-r--r--math.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/math.c b/math.c
index f0237d4fa9..dd98d8806e 100644
--- a/math.c
+++ b/math.c
@@ -620,12 +620,11 @@ math_sqrt(VALUE unused_obj, VALUE x)
return rb_math_sqrt(x);
}
-#define f_boolcast(x) ((x) ? Qtrue : Qfalse)
inline static VALUE
f_negative_p(VALUE x)
{
if (FIXNUM_P(x))
- return f_boolcast(FIX2LONG(x) < 0);
+ return RBOOL(FIX2LONG(x) < 0);
return rb_funcall(x, '<', 1, INT2FIX(0));
}
inline static VALUE
@@ -633,7 +632,7 @@ f_signbit(VALUE x)
{
if (RB_TYPE_P(x, T_FLOAT)) {
double f = RFLOAT_VALUE(x);
- return f_boolcast(!isnan(f) && signbit(f));
+ return RBOOL(!isnan(f) && signbit(f));
}
return f_negative_p(x);
}