[PD] factorial of negative values in [expr] / expr 0.56

Alexandre Torres Porres porres at gmail.com
Wed Jan 10 03:57:45 CET 2018

As long as we're discussing bugs in expr, I found a new one in the newly
added "Avg" function in 0.56, I just sent a fix, see

2018-01-09 18:41 GMT-03:00 Charles Z Henry <czhenry at gmail.com>:

> On Jan 9, 2018 12:52 PM, "Alexandre Torres Porres" <porres at gmail.com>
> wrote:
> Hi list and Shahrokh. What do you think the output from factorial of
> negative values? I read it's supposed to be minus infinity. Anyway, here's
> a issue I'm reporting that factorial of negative values in [expr] output 0
> and freeze Pd for a while: https://github.com/pure-data/p
> ure-data/issues/284
> The most consistent treatment would be to give it some value, other than
> -inf, which will propagate into NaN's in other calculations. Otherwise,
> outputs depend more on how denormals get handled rather than how Pd code is
> written. Outputs could vary from system to system and that's just buggy.
> The factorial is generalized by the gamma function which has values at
> non-zero and non-integer negative values, but it likely doesn't have much
> practical use in Pd. You could write an external if it actually matters to
> you for a project.
> So.... Since there's little point in being mathematically literal about
> it, it's fine to just choose a value (0 or 1) for values less than 1.  If
> it's me, I would choose 1, so that factorial calculations have the same
> value for bad inputs (values <1) as for the trivial input (=1).
> Chuck
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20180109/ca45037e/attachment.html>

More information about the Pd-list mailing list