On Apr 25, 2006, at 6:59 AM, <kei...@bt...> wrote:
> After "from pylab import *", log(0.0) gives
>
> Warning: Encountered divide by zero(s) in log
>
> Where is this behaviour documented? What does it mean? Why
> should log(0.0) divide by zero? What does the plural "zeros"
> refer to? Why break the IEEE standard that log(0.0) should
> silently return -Inf?
Adding to Robert's reply, I don't believe that the standard mandates
that programs should silently return Inf in the presence of divide by
zero errors. It does allow for programs to determine how they want
to respond to such errors, and numpy allows you to customize that.
You can ignore them, print a warning (the default I believe), or
raise an exception. Believe it or not, not everyone wants the same
behavior for all cases.
Perry
|