summaryrefslogtreecommitdiff
path: root/parse.y
diff options
context:
space:
mode:
Diffstat (limited to 'parse.y')
-rw-r--r--parse.y9
1 files changed, 9 insertions, 0 deletions
diff --git a/parse.y b/parse.y
index c28b9a9..df64763 100644
--- a/parse.y
+++ b/parse.y
@@ -9346,7 +9346,16 @@ negate_lit(NODE *node)
node->nd_lit = rb_funcall(node->nd_lit,tUMINUS,0,0);
break;
case T_FLOAT:
+#if USE_FLONUM
+ if (FLONUM_P(node->nd_lit)) {
+ node->nd_lit = DBL2NUM(-RFLOAT_VALUE(node->nd_lit));
+ }
+ else {
+ RFLOAT(node->nd_lit)->float_value = -RFLOAT_VALUE(node->nd_lit);
+ }
+#else
RFLOAT(node->nd_lit)->float_value = -RFLOAT_VALUE(node->nd_lit);
+#endif
break;
default:
break;