Le mardi 20 septembre 2016 04:02:16 UTC+2, Bill Page a écrit :
> In keeping with Richard's suggestion, in Sage I think a good
> _algebraic_ definition of 'real' is
> bool(x/2+conjugate(x)/2 == x)
why not bool(SR(x).imag_part()==0) ?
> sage: def RN(x):
> ....: try:
> ....: return bool(x/2+conjugate(x)/2 == x)
> ....: except:
> ....: return false
> which also works whenever conjugate is defined, including
> sage: assume(x,'real')
> sage: assume(y,'real')
> sage: RN(sqrt(x^2+y^2))
> > If arg(x) is 0 and x is a number, then it is a real number. Maxima
> > this carg() for complex arg.
> > Carg will also work for some things that are not of numeric type, but
> > symbolic in some way.
> > .
> > Like sqrt(x^2+y^2) is real if domain=real
> > Good luck
You received this message because you are subscribed to the Google Groups
To unsubscribe from this group and stop receiving emails from it, send an email
To post to this group, send email to firstname.lastname@example.org.
Visit this group at https://groups.google.com/group/sage-devel.
For more options, visit https://groups.google.com/d/optout.