Skip to content

Commit

Permalink
add link to JuliaLang/julia#14620 and explanation, remove this once r…
Browse files Browse the repository at this point in the history
…esolved
  • Loading branch information
Guy committed Jan 10, 2016
1 parent a78df62 commit 2cc1710
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/univariate/discrete/betabinomial.jl
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,9 @@ function cdf(d::BetaBinomial, x::Int)
c += pdf(d, y)
end

# this is needed due to the fact that pdf(d, y) can return values that are imprecise at higher decimal places and so due to the impl
# above we can end up with cdf values that are basically 1 but are either slightly greater or smaller
# TODO: remove when https://github.com/JuliaLang/julia/issues/14620 is resolved
# this is needed due to the fact that pdf(d, y) can return values that are imprecise at higher decimal places (due to https://github.com/JuliaLang/julia/issues/14620)
# and so due to the impl above we can end up with cdf values that are basically 1 but are either slightly greater or smaller
if abs(c - 1.0) < 1.0e-10
c = 1.0
end
Expand Down

0 comments on commit 2cc1710

Please sign in to comment.