summaryrefslogtreecommitdiff
path: root/bignum.c
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-29 01:07:15 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2011-08-29 01:07:15 +0000
commit640420f7044405cec4b1e6486caca4def5f80a45 (patch)
treefe7c8c31a09aaf3ccf0f483c9926c0528bde2513 /bignum.c
parent0d530b2392585cc535fb905f9ba4467257ef289c (diff)
* numeric.c (bit_coerce): A Fixnum and a Bignum are only permitted for
bitwise arithmetic with a Fixnum. #1792 * test/ruby/test_fixnum.rb: add tests for the above change. * bignum.c (bit_coerce): A Fixnum and a Bignum are only permitted for bitwise arithmetic with a Bignum. #1792 * test/ruby/test_bignum.rb: add tests for the above change. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@33108 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'bignum.c')
-rw-r--r--bignum.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/bignum.c b/bignum.c
index 9c289f7a8e..65e82d4e0f 100644
--- a/bignum.c
+++ b/bignum.c
@@ -3108,9 +3108,9 @@ static inline VALUE
bit_coerce(VALUE x)
{
while (!FIXNUM_P(x) && TYPE(x) != T_BIGNUM) {
- if (TYPE(x) == T_FLOAT) {
- rb_raise(rb_eTypeError, "can't convert Float into Integer");
- }
+ rb_raise(rb_eTypeError,
+ "can't convert %s into Integer for bitwise arithmetic",
+ rb_obj_classname(x));
x = rb_to_int(x);
}
return x;