summaryrefslogtreecommitdiff
path: root/math.c
diff options
context:
space:
mode:
Diffstat (limited to 'math.c')
-rw-r--r--math.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/math.c b/math.c
index 2043bebfe5..cc557c960c 100644
--- a/math.c
+++ b/math.c
@@ -16,7 +16,7 @@
VALUE rb_mMath;
extern VALUE rb_to_float(VALUE val);
-#define Need_Float(x) (x) = rb_to_float(x)
+#define Need_Float(x) do {if (TYPE(x) != T_FLOAT) {(x) = rb_to_float(x);}} while(0)
#define Need_Float2(x,y) do {\
Need_Float(x);\
Need_Float(y);\