mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +02:00
* 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
This commit is contained in:
parent
c4af7f51b7
commit
25c0cb981a
17 changed files with 213 additions and 197 deletions
|
@ -550,11 +550,11 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
|
|||
bin_retry:
|
||||
switch (TYPE(val)) {
|
||||
case T_FLOAT:
|
||||
if (FIXABLE((long)RFLOAT(val)->value)) {
|
||||
val = LONG2FIX((long)RFLOAT(val)->value);
|
||||
if (FIXABLE((long)RFLOAT_VALUE(val))) {
|
||||
val = LONG2FIX((long)RFLOAT_VALUE(val));
|
||||
goto bin_retry;
|
||||
}
|
||||
val = rb_dbl2big(RFLOAT(val)->value);
|
||||
val = rb_dbl2big(RFLOAT_VALUE(val));
|
||||
if (FIXNUM_P(val)) goto bin_retry;
|
||||
bignum = 1;
|
||||
break;
|
||||
|
@ -756,7 +756,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt)
|
|||
int i, need = 6;
|
||||
char fbuf[32];
|
||||
|
||||
fval = RFLOAT(rb_Float(val))->value;
|
||||
fval = RFLOAT_VALUE(rb_Float(val));
|
||||
if (isnan(fval) || isinf(fval)) {
|
||||
const char *expr;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue