Fix rational errors/bugs and better debug info

This commit is contained in:
pk-2000 2020-12-25 05:19:44 +02:00 committed by GitHub
parent bacca795c3
commit 90fda2da47
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 2 deletions

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));
}
}