Roots of unity

Hans Peter Würmli wurmli at freesurf.ch
Fri Jan 18 21:15:34 CET 2002


Bob, I was a bit too fast before. This function is better:

numeric qrt ( numeric x ){
  if (x.is_real()) return x.csgn()*pow(abs(x),1/numeric(3));
  else return pow(x,1/numeric(3));
};

Regards, H.P.

On Fri, 18 Jan 2002 10:25:37 -0600
Bob McElrath <mcelrath at draal.physics.wisc.edu> wrote:




More information about the GiNaC-list mailing list