Commit 14156559 authored by Daniel Kochmański's avatar Daniel Kochmański

complex-float: implement minus operation

parent 9e06e306
......@@ -167,6 +167,80 @@ ecl_minus(cl_object x, cl_object y)
cl_object z1 = ecl_minus(x->gencomplex.imag, y->gencomplex.imag);
return ecl_make_complex(z, z1);
}
#ifdef ECL_COMPLEX_FLOAT
/* upgraded type csfloat */
CASE_CSFLOAT_FIXNUM;
CASE_CSFLOAT_BIGNUM;
CASE_CSFLOAT_RATIO;
CASE_CSFLOAT_SINGLE_FLOAT;
CASE_CSFLOAT_COMPLEX;
CASE_FIXNUM_CSFLOAT;
CASE_BIGNUM_CSFLOAT;
CASE_RATIO_CSFLOAT;
CASE_SINGLE_FLOAT_CSFLOAT;
CASE_COMPLEX_CSFLOAT;
CASE_CSFLOAT_CSFLOAT {
cl_object aux = ecl_alloc_object(t_csfloat);
ecl_csfloat(aux) = ecl_to_csfloat(x) - ecl_to_csfloat(y);
return aux;
}
/* upgraded type cdfloat */
CASE_CSFLOAT_DOUBLE_FLOAT;
CASE_DOUBLE_FLOAT_CSFLOAT;
CASE_CDFLOAT_FIXNUM;
CASE_CDFLOAT_BIGNUM;
CASE_CDFLOAT_RATIO;
CASE_CDFLOAT_SINGLE_FLOAT;
CASE_CDFLOAT_DOUBLE_FLOAT;
CASE_CDFLOAT_COMPLEX;
CASE_CDFLOAT_CSFLOAT;
CASE_FIXNUM_CDFLOAT;
CASE_BIGNUM_CDFLOAT;
CASE_RATIO_CDFLOAT;
CASE_SINGLE_FLOAT_CDFLOAT;
CASE_DOUBLE_FLOAT_CDFLOAT;
CASE_COMPLEX_CDFLOAT;
CASE_CSFLOAT_CDFLOAT;
CASE_CDFLOAT_CDFLOAT {
cl_object aux = ecl_alloc_object(t_cdfloat);
ecl_cdfloat(aux) = ecl_to_cdfloat(x) - ecl_to_cdfloat(y);
return aux;
}
/* upgraded type clfloat */
CASE_CSFLOAT_LONG_FLOAT;
CASE_LONG_FLOAT_CSFLOAT;
CASE_CDFLOAT_LONG_FLOAT;
CASE_LONG_FLOAT_CDFLOAT;
CASE_CLFLOAT_FIXNUM;
CASE_CLFLOAT_BIGNUM;
CASE_CLFLOAT_RATIO;
CASE_CLFLOAT_SINGLE_FLOAT;
CASE_CLFLOAT_DOUBLE_FLOAT;
CASE_CLFLOAT_LONG_FLOAT;
CASE_CLFLOAT_COMPLEX;
CASE_CLFLOAT_CSFLOAT;
CASE_CLFLOAT_CDFLOAT;
CASE_FIXNUM_CLFLOAT;
CASE_BIGNUM_CLFLOAT;
CASE_RATIO_CLFLOAT;
CASE_SINGLE_FLOAT_CLFLOAT;
CASE_DOUBLE_FLOAT_CLFLOAT;
CASE_LONG_FLOAT_CLFLOAT;
CASE_COMPLEX_CLFLOAT;
CASE_CSFLOAT_CLFLOAT;
CASE_CDFLOAT_CLFLOAT;
CASE_CLFLOAT_CLFLOAT
{
cl_object aux = ecl_alloc_object(t_clfloat);
ecl_clfloat(aux) = ecl_to_clfloat(x) - ecl_to_clfloat(y);
return aux;
}
#endif
CASE_UNKNOWN(@[-],x,y,@[number]);
}
MATH_DISPATCH2_END;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment