Open
Description
When evaluating the expression std.mathspecial.sgnGamma(-0.5)
recently, I got 1
. This surprised me, because Γ(x) < 0
when -1 < x < 0
. Looking at the source code, I see that rndtol
is used to convert x
to an integer for binning. Depending on the rounding mode, -0.5
will be rounded to either 0
or -1
. I think this is the source of my error. Since the domain boundaries are the no positive integers, it might be better to use a function like trunc
that will map negative numbers in the same domain to the same integer, since it doesn't rely on the rounding mode.
Metadata
Metadata
Assignees
Labels
No labels