diff options
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | sprintf.c | 3 |
2 files changed, 2 insertions, 3 deletions
@@ -1,4 +1,4 @@ -Thu Mar 6 15:16:55 2008 NAKAMURA Usaku <usa@ruby-lang.org> +Thu Mar 6 15:44:20 2008 NAKAMURA Usaku <usa@ruby-lang.org> * sprintf.c (rb_str_format): casting double to long is undefined if the interger part of double is out of the range of long. @@ -540,8 +540,7 @@ rb_str_format(int argc, const VALUE *argv, VALUE fmt) bin_retry: switch (TYPE(val)) { case T_FLOAT: - if (RFLOAT_VALUE(val) <= LONG_MAX && - RFLOAT_VALUE(val) >= LONG_MIN) { + if (FIXABLE(RFLOAT_VALUE(val))) { val = LONG2FIX((long)RFLOAT_VALUE(val)); goto bin_retry; } |