On Oct 30, 2:58 pm, David Roe <roed.m...@gmail.com> wrote:
> I think this is a bug: the type of the result should be consistent.
> David

Consistent doesn't mean constant. Functions like "sin" are generic
functions that dispatch on input type:

sin(1.2) should return a float, not a symbolic expression (that would
be unacceptably inefficient in numerical contexts).

sin(1) should return a symbolic expression because there's no
indication an approximation is supposed to be made.

sin(0) is ambiguous that way, so a return type is chosen that behaves
well in either context.

Perhaps it shouldn't be "int" but "symbolic" is a bad choice.

There probably already is (and otherwise there should be) something
like

numerical.sin: always return numerical result
     (probably needs precision parameters and parent of return value)
symbolic.sin: always return symbolic result

and then the top-level sin dispatches over those via a convenient
heuristic.

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