On Aug 28, 8:18 pm, Golam Mortuza Hossain <gmhoss...@gmail.com> wrote:
> Hi,
>
> On Fri, Aug 28, 2009 at 11:02 AM, kcrisman<kcris...@gmail.com> wrote:
>
> > I'm working on #6388,
>
> Thanks for taking the effort on this bug.
>
> > sage: a = Integer(-1)
> > sage: a.log()
> > ValueError about input being negative
> > sage: log(-1)
> > Same ValueError, since preparser turns -1 into Integer(-1)
> > sage: log(SR(-1))
> > I*pi
> > sage: log(CC(-1))
> > 3.14...*I
>
> > Would anything break if a.log() returned a symbolic answer as above?
> > Alternately, one could place a check in the global log() for
> > nonpositive integers and make them symbolic before moving on.  Or one
> > could leave the existing behavior and just document it better.
>
> Please return a log value for integer and float arguments that is
> consistent with rest of the Sage.  As you said, for CC and SR arguments,
> log() returns acceptable answer. So it would be desirable that we get 
> compatible
> answers also for integer and floats. Currently, we get
> ---------
> sage: log(-1.0)
> NaN
> sage: log(-1 + 0*I)
> pi*I
> sage: log(-1)
> ...
> ValueError: self must be positive
> ---------

With no response in three days, I am assuming nothing bad would happen
to integer stuff.  I sort of like log(-1) giving an error but as long
as log? makes it very clear why you get an answer (and which branch we
choose!) this is okay with me.

>
> > Something similar happens for input zero, except here SR(0) and CC(0)
> > give various forms of infinity while the request is for log(0) as an
> > answer.
>
> I guess, a consistent convention of "-oo" is perfectly acceptable for log(0).
> My main concern was that it is raising error instead of  returning
> at the least, unevaluated symbolic expression.

Okay, I like that better than sometimes -Infinity and sometimes log
(0).  Hopefully I'll have time to finish this relatively soon.
- kcrisman


--~--~---------~--~----~------------~-------~--~----~
To post to this group, send an email to sage-devel@googlegroups.com
To unsubscribe from this group, send an email to 
sage-devel-unsubscr...@googlegroups.com
For more options, visit this group at http://groups.google.com/group/sage-devel
URLs: http://www.sagemath.org
-~----------~----~----~----~------~----~------~--~---

Reply via email to