Skip to content
This repository

FloatingPointError with logaddexp([-inf], [-inf]) #2714

Open
roger- opened this Issue November 07, 2012 · 1 comment

2 participants

Roger Pauli Virtanen
Roger

Get this with NumPy 1.6.2 (32 bit) on Windows 7:

    >> np.seterr('raise');print np.logaddexp([-inf], [-inf])
    FloatingPointError: invalid value encountered in logaddexp

The correct result log(0) = -inf is returned, but I think this is a common enough use-case that logaddexp() should account for it without raising any warnings/exceptions.

Pauli Virtanen
Owner
pv commented November 07, 2012

The result is correct, but the FP exception should either be overflow rather than invalid, or be absent.
Following the logic in C99, the correct choice would be to not raise an exception.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.