> I am still using Singular 1-2-3
> I don't know how to compute the real part
> of an element in Q[i], i^2=-1.
> The manual says nothing about complex conjugation.
> I am aware that Singular 2 has complex numbers,
> but do I really have to install it just to
> use complex conjugation (on the coefficients
> of a polynomial ring)?
Probably there is no way to do it with Singular-1-2-3,
since working with "numbers" is not very easy.
Anyway you can define some procedure like thie above
one (I think it should work even with that version).
I assume you are in a polynomial ring of char=0
and minpoly=i^2+1.
proc real_part (number a)
{
def BR=basering;
string rea=string(a);
ring auxR=0,i,lp;
execute("poly Rea="+rea+";");
Rea=subst(Rea,i,0);
rea=string(Rea);
setring BR;
kill(auxR);
execute("number REa="+rea+";");
return(REa);
}
Good luck.
email:
ignfar@eis.uva.esPosted in old Singular Forum on: 2002-04-29 11:29:38+02