Rational errors fix #239

Open
pk-2000 wants to merge 1 commits from pk-2000/test-RUBY_T_RATIONAL into master
1 changed files with 3 additions and 2 deletions
Showing only changes of commit a5a12ecf21 - Show all commits

View File

@ -228,7 +228,7 @@ rb_float_arg(VALUE arg, double *out, int argPos = 0)
break;
default:
rb_raise(rb_eTypeError, "Argument %d: Expected float", argPos);
rb_raise(rb_eTypeError, "Argument %d: Expected float(got 0x%x)", argPos, rb_type(arg));
}
}
@ -243,11 +243,12 @@ rb_int_arg(VALUE arg, int *out, int argPos = 0)
break;
case RUBY_T_FIXNUM :
case RUBY_T_RATIONAL :
*out = FIX2INT(arg);
break;
default:
rb_raise(rb_eTypeError, "Argument %d: Expected fixnum", argPos);
rb_raise(rb_eTypeError, "Argument %d: Expected fixnum(got 0x%x)", argPos, rb_type(arg));
}
}