diff options
author | S.H <gamelinks007@gmail.com> | 2021-08-18 02:25:19 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-08-18 02:25:19 +0900 |
commit | 58bd9434360d5a46974eaa03139893c0145615dc (patch) | |
tree | 9ed044f8c37e0dfbdf54d0f784b85031bce57dd6 /math.c | |
parent | 6a9bfa4d9387b9d8f07f43f4546437be57f9e27c (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.c | 5 |
1 files changed, 2 insertions, 3 deletions
@@ -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); } |