On 16 June, 07:48, rjf <[email protected]> wrote:
> By your reasoning, and for other domains we would have the following > behavior: > > 1-2 --> error. 1 and 2 are both positive integers. In order to > provide the answer -1, one must > expand the domain to include negative integers. > > 1 / 2 --> error.. (integers vs. rationals). Indeed there are > some systems (Axiom) that warn about such things. > > sqrt(-1) --> error. after all, some Sage users may not have > encountered imaginary numbers. This is not correct, because by "domain" I meant "the set on which the function is defined", i.e. the set of permissible *inputs* to the function. With this definition of domain, none of the operations you discuss should raise an error: there is no reason in general why the *output* from a function should lie in the domain of that function. That said, if the consensus is that factorial(x) should be analytically continued, to allow x to be an explicit non-integral number (as is the case in Maple and Mathematica), then I am happy with this. But then we should change the documentation of factorial() to make this clear. At the moment there does not seem to be a clear consensus either way. If you have an opinion on this, please vote! Let x be an explicit numerical value such that x is not a non-negative integer (e.g. x=2/3, x=1.5, or x=i). The options are: A) factorial(x) should raise an error; B) factorial(x) should return gamma(x+1). Best, Tom -- To post to this group, send an email to [email protected] To unsubscribe from this group, send an email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-devel URL: http://www.sagemath.org
