mirror of
https://github.com/PHPOffice/PhpSpreadsheet.git
synced 2026-09-30 00:48:01 +00:00
2a82540c1f
GammaBase::calculateInverse fixed its upper bound at alpha*beta*5, so any GAMMA.INV/GAMMAINV quantile larger than that was clamped to it: e.g. GAMMAINV(0.9999, 1, 1) returned 5 rather than ~9.2103, breaking the round-trip GAMMADIST(GAMMAINV(p)) == p. Grow the upper bound geometrically until it brackets the root. If the CDF stops increasing first (the series approximation is past its usable range) keep the original bound instead of expanding into it, which also stops a probability the series cannot reach from running the bound away.