summaryrefslogtreecommitdiff
path: root/internal/numeric.h
diff options
context:
space:
mode:
author卜部昌平 <shyouhei@ruby-lang.org>2019-12-03 10:48:45 +0900
committer卜部昌平 <shyouhei@ruby-lang.org>2019-12-26 20:45:12 +0900
commitf6dc053faf6a8850c50638b5e06fca9e878de7ae (patch)
tree2bf0dd2be83471a2d7e690d2e93222511fe2bd5a /internal/numeric.h
parent68c0dc8d363675881d60b9fde15645d9ee14fafc (diff)
internal/fixnum.h rework
Add #include lines, move FIXNUM_POSITIVE_P etc. from numeric.h.
Notes
Notes: Merged: https://github.com/ruby/ruby/pull/2711
Diffstat (limited to 'internal/numeric.h')
-rw-r--r--internal/numeric.h5
1 files changed, 1 insertions, 4 deletions
diff --git a/internal/numeric.h b/internal/numeric.h
index 3e64b82daf..c85327ea82 100644
--- a/internal/numeric.h
+++ b/internal/numeric.h
@@ -9,6 +9,7 @@
* modify this file, provided that the conditions mentioned in the
* file COPYING are met. Consult the file for details.
*/
+#include "internal/fixnum.h" /* for FIXNUM_POSITIVE_P */
struct RFloat {
struct RBasic basic;
@@ -19,10 +20,6 @@ struct RFloat {
/* numeric.c */
-#define FIXNUM_POSITIVE_P(num) ((SIGNED_VALUE)(num) > (SIGNED_VALUE)INT2FIX(0))
-#define FIXNUM_NEGATIVE_P(num) ((SIGNED_VALUE)(num) < 0)
-#define FIXNUM_ZERO_P(num) ((num) == INT2FIX(0))
-
#define INT_NEGATIVE_P(x) (FIXNUM_P(x) ? FIXNUM_NEGATIVE_P(x) : BIGNUM_NEGATIVE_P(x))
#define FLOAT_ZERO_P(x) (RFLOAT_VALUE(x) == 0.0)