1818
1919VALUE rb_cComplex ;
2020
21- static ID id_abs , id_abs2 , id_arg , id_cmp , id_conj , id_convert ,
22- id_denominator , id_divmod , id_eqeq_p , id_expt , id_fdiv , id_floor ,
23- id_idiv , id_imag , id_inspect , id_negate , id_numerator , id_quo ,
24- id_real , id_real_p , id_to_f , id_to_i , id_to_r , id_to_s ,
21+ static ID id_abs , id_arg , id_convert ,
22+ id_denominator , id_eqeq_p , id_expt , id_fdiv ,
23+ id_inspect , id_negate , id_numerator , id_quo ,
24+ id_real_p , id_to_f , id_to_i , id_to_r , id_to_s ,
2525 id_i_real , id_i_imag ;
2626
2727#define f_boolcast (x ) ((x) ? Qtrue : Qfalse)
@@ -75,20 +75,6 @@ f_add(VALUE x, VALUE y)
7575 return rb_funcall (x , '+' , 1 , y );
7676}
7777
78- inline static VALUE
79- f_cmp (VALUE x , VALUE y )
80- {
81- if (FIXNUM_P (x ) && FIXNUM_P (y )) {
82- long c = FIX2LONG (x ) - FIX2LONG (y );
83- if (c > 0 )
84- c = 1 ;
85- else if (c < 0 )
86- c = -1 ;
87- return INT2FIX (c );
88- }
89- return rb_funcall (x , id_cmp , 1 , y );
90- }
91-
9278inline static VALUE
9379f_div (VALUE x , VALUE y )
9480{
@@ -105,16 +91,6 @@ f_gt_p(VALUE x, VALUE y)
10591 return rb_funcall (x , '>' , 1 , y );
10692}
10793
108- inline static VALUE
109- f_lt_p (VALUE x , VALUE y )
110- {
111- if (FIXNUM_P (x ) && FIXNUM_P (y ))
112- return f_boolcast (FIX2LONG (x ) < FIX2LONG (y ));
113- return rb_funcall (x , '<' , 1 , y );
114- }
115-
116- binop (mod , '%' )
117-
11894inline static VALUE
11995f_mul (VALUE x , VALUE y )
12096{
@@ -152,16 +128,11 @@ f_sub(VALUE x, VALUE y)
152128}
153129
154130fun1 (abs )
155- fun1 (abs2 )
156131fun1 (arg )
157- fun1 (conj )
158132fun1 (denominator )
159- fun1 (floor )
160- fun1 (imag )
161133fun1 (inspect )
162134fun1 (negate )
163135fun1 (numerator )
164- fun1 (real )
165136fun1 (real_p )
166137
167138inline static VALUE
@@ -182,8 +153,6 @@ f_to_f(VALUE x)
182153fun1 (to_r )
183154fun1 (to_s )
184155
185- fun2 (divmod )
186-
187156inline static VALUE
188157f_eqeq_p (VALUE x , VALUE y )
189158{
@@ -194,7 +163,6 @@ f_eqeq_p(VALUE x, VALUE y)
194163
195164fun2 (expt )
196165fun2 (fdiv )
197- fun2 (idiv )
198166fun2 (quo )
199167
200168inline static VALUE
@@ -257,12 +225,6 @@ k_numeric_p(VALUE x)
257225 return f_kind_of_p (x , rb_cNumeric );
258226}
259227
260- inline static VALUE
261- k_integer_p (VALUE x )
262- {
263- return f_kind_of_p (x , rb_cInteger );
264- }
265-
266228inline static VALUE
267229k_fixnum_p (VALUE x )
268230{
@@ -456,13 +418,6 @@ nucomp_s_new(int argc, VALUE *argv, VALUE klass)
456418 return nucomp_s_canonicalize_internal (klass , real , imag );
457419}
458420
459- inline static VALUE
460- f_complex_new1 (VALUE klass , VALUE x )
461- {
462- assert (!k_complex_p (x ));
463- return nucomp_s_canonicalize_internal (klass , x , ZERO );
464- }
465-
466421inline static VALUE
467422f_complex_new2 (VALUE klass , VALUE x , VALUE y )
468423{
@@ -537,7 +492,6 @@ m_log_bang(VALUE x)
537492
538493imp1 (sin )
539494imp1 (sinh )
540- imp1 (sqrt )
541495
542496static VALUE
543497m_cos (VALUE x )
@@ -570,6 +524,8 @@ m_sin(VALUE x)
570524}
571525
572526#if 0
527+ imp1 (sqrt )
528+
573529static VALUE
574530m_sqrt (VALUE x )
575531{
@@ -2098,24 +2054,16 @@ Init_Complex(void)
20982054 assert (fprintf (stderr , "assert() is now active\n" ));
20992055
21002056 id_abs = rb_intern ("abs" );
2101- id_abs2 = rb_intern ("abs2" );
21022057 id_arg = rb_intern ("arg" );
2103- id_cmp = rb_intern ("<=>" );
2104- id_conj = rb_intern ("conj" );
21052058 id_convert = rb_intern ("convert" );
21062059 id_denominator = rb_intern ("denominator" );
2107- id_divmod = rb_intern ("divmod" );
21082060 id_eqeq_p = rb_intern ("==" );
21092061 id_expt = rb_intern ("**" );
21102062 id_fdiv = rb_intern ("fdiv" );
2111- id_floor = rb_intern ("floor" );
2112- id_idiv = rb_intern ("div" );
2113- id_imag = rb_intern ("imag" );
21142063 id_inspect = rb_intern ("inspect" );
21152064 id_negate = rb_intern ("-@" );
21162065 id_numerator = rb_intern ("numerator" );
21172066 id_quo = rb_intern ("quo" );
2118- id_real = rb_intern ("real" );
21192067 id_real_p = rb_intern ("real?" );
21202068 id_to_f = rb_intern ("to_f" );
21212069 id_to_i = rb_intern ("to_i" );
0 commit comments