summaryrefslogtreecommitdiff
path: root/internal.h
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-09 07:05:37 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2019-01-09 07:05:37 +0000
commitfc9e0302ea6756e0ea95dbc11216a3a776ad16a6 (patch)
treed92ebe56e6e702b77db3c8c6693cafd1c41435c8 /internal.h
parentf7c0abeaeaba157b6535b397a4fd551e204608d3 (diff)
complex.c: optimize zero check for Float
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66758 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'internal.h')
-rw-r--r--internal.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/internal.h b/internal.h
index f57c1b73cd..3205050ec2 100644
--- a/internal.h
+++ b/internal.h
@@ -1617,6 +1617,8 @@ void Init_newline(void);
#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)
+
#ifndef ROUND_DEFAULT
# define ROUND_DEFAULT RUBY_NUM_ROUND_HALF_UP
#endif