add mrb_float_p()

This commit is contained in:
Yukihiro Matz Matsumoto
2012-11-04 04:51:13 +09:00
parent 3ba521ae9e
commit da88627a37
2 changed files with 2 additions and 1 deletions
+1 -1
View File
@@ -878,7 +878,7 @@ static mrb_value
bit_coerce(mrb_state *mrb, mrb_value x)
{
while (!mrb_fixnum_p(x)) {
if (mrb_type(x) == MRB_TT_FLOAT) {
if (mrb_float_p(x)) {
mrb_raise(mrb, E_TYPE_ERROR, "can't convert Float into Integer");
}
x = mrb_to_int(mrb, x);