1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

* lib/cmath.rb: new.

* lib/complex.rb: depends lib/cmath.rb.

	* lib/rational.rb: added rdiv.

	* complex.c: removed some math functions.



git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@15906 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
tadf 2008-04-05 14:25:40 +00:00
parent be710a0391
commit c08b5dfb81
7 changed files with 269 additions and 132 deletions

View file

@ -777,13 +777,9 @@ nurat_mul(VALUE self, VALUE other)
}
}
#define id_to_r rb_intern("to_r")
#define f_to_r(x) rb_funcall(x, id_to_r, 0)
static VALUE
nurat_div(VALUE self, VALUE other)
{
again:
switch (TYPE(other)) {
case T_FIXNUM:
case T_BIGNUM:
@ -1407,6 +1403,9 @@ string_to_r(VALUE self)
return rb_rational_new1(INT2FIX(0));
}
#define id_to_r rb_intern("to_r")
#define f_to_r(x) rb_funcall(x, id_to_r, 0)
static VALUE
nurat_s_convert(int argc, VALUE *argv, VALUE klass)
{