mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* complex.c (nucomp_real_check): raise TypeError instead of ArgumentError
when argument is not a real as expected [ruby-core:28395] * rational.c (nurat_int_check): ditto (for integers) git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26805 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
b81e045712
commit
215b8092a7
3 changed files with 10 additions and 2 deletions
|
@ -1,3 +1,11 @@
|
|||
Wed Mar 3 23:16:32 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||
|
||||
* complex.c (nucomp_real_check): raise TypeError instead of
|
||||
ArgumentError when argument is not a real as expected
|
||||
[ruby-core:28395]
|
||||
|
||||
* rational.c (nurat_int_check): ditto (for integers)
|
||||
|
||||
Wed Mar 3 23:07:08 2010 Marc-Andre Lafortune <ruby-core@marc-andre.ca>
|
||||
|
||||
* lib/matrix.rb (Vector#each): Return self and optimization
|
||||
|
|
|
@ -377,7 +377,7 @@ nucomp_real_check(VALUE num)
|
|||
break;
|
||||
default:
|
||||
if (!k_numeric_p(num) || !f_real_p(num))
|
||||
rb_raise(rb_eArgError, "not a real");
|
||||
rb_raise(rb_eTypeError, "not a real");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -419,7 +419,7 @@ nurat_int_check(VALUE num)
|
|||
break;
|
||||
default:
|
||||
if (!k_numeric_p(num) || !f_integer_p(num))
|
||||
rb_raise(rb_eArgError, "not an integer");
|
||||
rb_raise(rb_eTypeError, "not an integer");
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue