In keeping with Richard's suggestion, in Sage I think a good
_algebraic_ definition of 'real' is

    bool(x/2+conjugate(x)/2 == x)


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))

On 19 September 2016 at 19:51, rjf <> wrote:
> If arg(x) is 0 and x is a number, then it is a real number.  Maxima calls
> 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 
"sage-devel" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
To post to this group, send email to
Visit this group at
For more options, visit

Reply via email to