From 25c0cb981af8fda9860ec6e365b9ea7a9e3f498f Mon Sep 17 00:00:00 2001
From: ko1 <ko1@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>
Date: Tue, 13 Nov 2007 16:00:53 +0000
Subject: * include/ruby/ruby.h: introduce 2 macros:   RFLOAT_VALUE(v),
 DOUBLE2NUM(dbl).   Rename RFloat#value -> RFloat#double_value.   Do not touch
 RFloat#double_value directly. * bignum.c, insns.def, marshal.c, math.c,
 numeric.c, object.c,   pack.c, parse.y, process.c, random.c, sprintf.c,
 string.c,   time.c: apply above changes. * ext/dl/mkcallback.rb,
 ext/json/ext/generator/generator.c:   ditto.

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13913 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
---
 insns.def | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

(limited to 'insns.def')

diff --git a/insns.def b/insns.def
index ee6de0a845..374445d38b 100644
--- a/insns.def
+++ b/insns.def
@@ -1391,7 +1391,7 @@ opt_plus
 	else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
 		 HEAP_CLASS_OF(obj) == rb_cFloat &&
 		 BASIC_OP_UNREDEFINED_P(BOP_PLUS)) {
-	    val = rb_float_new(RFLOAT(recv)->value + RFLOAT(obj)->value);
+	    val = DOUBLE2NUM(RFLOAT_VALUE(recv) + RFLOAT_VALUE(obj));
 	}
 #endif
 
@@ -1492,7 +1492,7 @@ opt_mult
 	else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
 		 HEAP_CLASS_OF(obj) == rb_cFloat  &&
 		 BASIC_OP_UNREDEFINED_P(BOP_MULT)) {
-	    val = rb_float_new(RFLOAT(recv)->value * RFLOAT(obj)->value);
+	    val = DOUBLE2NUM(RFLOAT_VALUE(recv) * RFLOAT_VALUE(obj));
 	}
 #endif
 	else {
@@ -1556,7 +1556,7 @@ opt_div
 	else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
 		 HEAP_CLASS_OF(obj) == rb_cFloat  &&
 		 BASIC_OP_UNREDEFINED_P(BOP_DIV)) {
-	    val = rb_float_new(RFLOAT(recv)->value / RFLOAT(obj)->value);
+	    val = DOUBLE2NUM(RFLOAT_VALUE(recv) / RFLOAT_VALUE(obj));
 	}
 #endif
 	else {
@@ -1620,8 +1620,8 @@ opt_mod
 	else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
 		 HEAP_CLASS_OF(obj) == rb_cFloat &&
 		 BASIC_OP_UNREDEFINED_P(BOP_MOD)) {
-	    double x = RFLOAT(recv)->value;
-	    double y = RFLOAT(obj)->value;
+	    double x = RFLOAT_VALUE(recv);
+	    double y = RFLOAT_VALUE(obj);
 	    double div, mod;
 
 	    {
@@ -1636,7 +1636,7 @@ opt_mod
 		mod += y;
 		div -= 1.0;
 	    }
-	    val = rb_float_new(mod);
+	    val = DOUBLE2NUM(mod);
 	}
 	else {
 	    goto INSN_LABEL(normal_dispatch);
@@ -1678,8 +1678,8 @@ opt_eq
 	else if (HEAP_CLASS_OF(recv) == rb_cFloat &&
 		 HEAP_CLASS_OF(obj) == rb_cFloat &&
 		 BASIC_OP_UNREDEFINED_P(BOP_EQ)) {
-	    double a = RFLOAT(recv)->value;
-	    double b = RFLOAT(obj)->value;
+	    double a = RFLOAT_VALUE(recv);
+	    double b = RFLOAT_VALUE(obj);
 
 	    if (isnan(a) || isnan(b)) {
 		val = Qfalse;
-- 
cgit v1.2.3

