[GiNaC-devel] evalf() on cube roots

Richard B. Kreckel kreckel at in.terlu.de
Sun Aug 2 19:09:54 CEST 2015


Hi,

On 08/01/2015 08:01 PM, Jan Rheinländer wrote:
> I noticed that
> 
> evalf( (-1)^(1/3) )
> 
> gives
> 
> 0.5+0.86602540378443864673*I
> 
> Is there any way to tell GiNaC to return the real root by default?

There isn't. GiNaC, like almost all other systems, returns the solution
on the principal branch, compatible with exp(log(-1)/3).

  -richy.
-- 
Richard B. Kreckel
<http://in.terlu.de/~kreckel/>


More information about the GiNaC-devel mailing list