diff --git a/Project.toml b/Project.toml index 5cda14603..341fb436c 100644 --- a/Project.toml +++ b/Project.toml @@ -1,7 +1,7 @@ name = "Distributions" uuid = "31c24e10-a181-5473-b8eb-7969acd0382f" authors = ["JuliaStats"] -version = "0.25.112" +version = "0.25.113" [deps] AliasTables = "66dad0bd-aa9a-41b7-9441-69ab47430ed8" diff --git a/src/univariate/discrete/geometric.jl b/src/univariate/discrete/geometric.jl index f89cebfed..f7f940ee4 100644 --- a/src/univariate/discrete/geometric.jl +++ b/src/univariate/discrete/geometric.jl @@ -30,7 +30,7 @@ struct Geometric{T<:Real} <: DiscreteUnivariateDistribution end function Geometric(p::Real; check_args::Bool=true) - @check_args Geometric (p, zero(p) < p < one(p)) + @check_args Geometric (p, zero(p) < p <= one(p)) return Geometric{typeof(p)}(p) end diff --git a/test/univariate/discrete/geometric.jl b/test/univariate/discrete/geometric.jl index 9845946db..82f7a1e2c 100644 --- a/test/univariate/discrete/geometric.jl +++ b/test/univariate/discrete/geometric.jl @@ -18,3 +18,8 @@ using FiniteDifferences test_cgf(Geometric(0.1), (1f-1, -1e6)) test_cgf(Geometric(0.5), (1f-1, -1e6)) end + +@testset "Support" begin + @test rand(Geometric(1)) == 0 + @test_throws DomainError Geometric(0) +end