aboutsummaryrefslogtreecommitdiffstats
path: root/numeric.c
diff options
context:
space:
mode:
Diffstat (limited to 'numeric.c')
-rw-r--r--numeric.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/numeric.c b/numeric.c
index ab890c6153..96a3022e84 100644
--- a/numeric.c
+++ b/numeric.c
@@ -2917,10 +2917,9 @@ static 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");
- }
- x = rb_to_int(x);
+ rb_raise(rb_eTypeError,
+ "can't convert %s into Integer for bitwise arithmetic",
+ rb_obj_classname(x));
}
return x;
}