File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -21,18 +21,19 @@ function _logabsgamma(x::Float32)
21
21
22
22
#= purge off +-inf, NaN, +-0, tiny and negative arguments =#
23
23
signgam = 1
24
+ isneg = hx < Int32 (0 )
24
25
ix = hx & 0x7fffffff
25
26
ix ≥ 0x7f800000 && return x * x, signgam
26
27
ix == 0x00000000 && return Inf32 , signgam
27
28
if ix < 0x35000000 #= |x|<2**-21, return -log(|x|) =#
28
- if hx < Int32 ( 0 )
29
+ if isneg
29
30
signgam = - 1
30
31
return - log (- x), signgam
31
32
else
32
33
return - log (x), signgam
33
34
end
34
35
end
35
- if hx < Int32 ( 0 )
36
+ if isneg
36
37
# ix ≥ 0x4b000000 && return Inf32, signgam #= |x|>=2**23, must be -integer =#
37
38
t = sinpi (x)
38
39
t == 0.0f0 && return Inf32 , signgam #= -integer =#
@@ -98,7 +99,7 @@ function _logabsgamma(x::Float32)
98
99
#= 2^58 ≤ x ≤ Inf =#
99
100
r = muladd (x, log (x), - x)
100
101
end
101
- if hx < Int32 ( 0 )
102
+ if isneg
102
103
r = nadj - r
103
104
end
104
105
return r, signgam
You can’t perform that action at this time.
0 commit comments