On Wed, 31 Oct 2012 05:05:24 -0700 (PDT)
kcrisman <kcris...@gmail.com> wrote:

> On Wednesday, October 31, 2012 6:01:07 AM UTC-4, Volker Braun wrote:
> >
> > On Tuesday, October 30, 2012 11:08:15 PM UTC, Fredrik Johansson
> > wrote:
> >
> >> Returning a Sage Integer would be consistent with this: 
> >
> >
> > I also think that returning a Sage integer is the appropriate thing
> > to do. 
> >
> 
> I've updated #10133 with this apparent consensus.  Note that in the
> partial duplicate #10972 Burcin seemed to think that they should
> return symbolic expressions, but Simon's argument seems reasonable to
> me as well.

???

The quote on that ticket is from you:

https://groups.google.com/d/topic/sage-support/bcwwTYozl6I/discussion

We normally try to match the type of the output to that of the input.
In the sin(pi) example, pi is a a symbolic expression and the output
comes out as a symbolic expression. This also works for inexact input:

sage: type(sin(pi))
<type 'sage.symbolic.expression.Expression'>
sage: type(sin(0.))
<type 'sage.rings.real_mpfr.RealNumber'>

There is an inconsistency for exact input, since making that return a
type compatible with the input either requires changing pynac, or
slowing down all (symbolic) special function evaluation by introducing
a check for this case.

As you pointed out earlier, this is #10133. I will eventually fix it
when I find time. I'd be happy to explain what needs to be done to
volunteers.


Cheers,
Burcin

-- 
You received this message because you are subscribed to the Google Groups 
"sage-devel" group.
To post to this group, send email to sage-devel@googlegroups.com.
To unsubscribe from this group, send email to 
sage-devel+unsubscr...@googlegroups.com.
Visit this group at http://groups.google.com/group/sage-devel?hl=en.


Reply via email to