Skip to content

Commit e0bfd8c

Browse files
Merge pull request #90 from AayushSabharwal/as/lgamma
fix: fix fallback for `lgamma`
2 parents 291ca27 + d34b1d8 commit e0bfd8c

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/NaNMath.jl

+1-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,7 @@ for f in (:sin, :cos, :tan, :asin, :acos, :acosh, :atanh,
1111
x === xf && throw(MethodError($f, (x,)))
1212
($f)(xf)
1313
end
14-
if $f !== :lgamma
15-
($f)(x) = (Base.$f)(x)
16-
end
14+
$(f !== :lgamma ? :(($f)(x) = (Base.$f)(x)) : :())
1715
end
1816
end
1917

test/runtests.jl

+1
Original file line numberDiff line numberDiff line change
@@ -223,6 +223,7 @@ for f in (:sin, :cos, :tan, :asin, :acos, :acosh, :atanh, :log, :log2, :log10,
223223
:log1p, :sqrt)
224224
@test @eval (NaNMath.$f)(x) == $f(x)
225225
end
226+
@test_throws MethodError NaNMath.lgamma(x)
226227

227228
struct A end
228229
Base.isless(::A, ::A) = false

0 commit comments

Comments
 (0)