octave-bug-tracker
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Octave-bug-tracker] [bug #43551] Matlab incompatibility for gamma funct


From: Rik
Subject: [Octave-bug-tracker] [bug #43551] Matlab incompatibility for gamma function for negative integer arguments
Date: Fri, 07 Nov 2014 17:06:29 +0000
User-agent: Mozilla/5.0 (X11; Ubuntu; Linux x86_64; rv:33.0) Gecko/20100101 Firefox/33.0

Follow-up Comment #3, bug #43551 (project octave):

That's kind of what I expected.  It does seem like it would be more useful to
return Inf and have terms go to zero.

I was just picking up the patch that someone had supplied so I don't know much
about the code.

The mod 2 thing seems to be trying to get the phase to be consistent for
negative integers.  The result of the gamma function is only infinite when x
is a negative integer (or when X itself is +Inf).  So the code, by checking
xisinf (result), is effectively deciding that x itself was a negative integer.
 The next test will determine whether x was an even or odd integer and will
flip the phase (+1,-1,+1,-1) to go with the absolute magnitude of infinity. 
This corresponds to consistently taking the limit from the right.

    _______________________________________________________

Reply to this item at:

  <http://savannah.gnu.org/bugs/?43551>

_______________________________________________
  Message sent via/by Savannah
  http://savannah.gnu.org/




reply via email to

[Prev in Thread] Current Thread [Next in Thread]