Skip to content

Conversation

@BrianHung
Copy link
Owner

Summary

  • implement BETA.DIST/BETA.INV
  • implement GAMMA.DIST/GAMMA.INV/GAMMA/GAMMALN and GAMMALN.PRECISE
  • implement EXPON.DIST, WEIBULL.DIST, POISSON.DIST
  • implement BINOM.DIST/BINOM.INV/BINOM.DIST.RANGE
  • add comprehensive tests
  • document availability of new functions

Testing

  • cargo test -p ironcalc_base --no-fail-fast

https://chatgpt.com/codex/tasks/task_e_688a6eca2e848327b398900aa2fb4585

Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bugbot free trial expires on August 2, 2025
Learn more in the Cursor dashboard.

CalcResult::Number(dist.cdf(k))
} else {
CalcResult::Number(dist.pmf(k))
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Numeric Conversion Errors in Statistical Functions

The f64 to u64 conversions in fn_poisson_dist, fn_binom_dist, and fn_binom_dist_range can panic. This occurs for negative input values (including NaN or negative infinity, due to premature casting before validation) or for excessively large positive values exceeding u64::MAX. This leads to a crash instead of returning a NUM error.

Fix in Cursor Fix in Web

@BrianHung BrianHung changed the title Add statistical distribution functions beta.dist, beta.inv, gamma.gist, gamma.inv, gamma, gammaln, gammaln.precise, expon.dist, weibull.dist, poisson.dist, binom.dist, binom.inv, binom.dist.range Aug 6, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants