Hi,
On Fri, Aug 28, 2009 at 11:02 AM, kcrisman<[email protected]> 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 --------- > 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. Thanks, Golam --~--~---------~--~----~------------~-------~--~----~ 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 URLs: http://www.sagemath.org -~----------~----~----~----~------~----~------~--~---
