Cockatrice/cockatrice
Lukas Brübach a438be8bda [Analytics] Return zero instead of NaN for impossible draw probabilities
The draw-probability widget computes a hypergeometric probability as a sum of
qLn terms. Two argument combinations reach a non-positive term and return NaN,
which the results table prints as "nan":

- k > K, asking for more copies than the deck holds. A deck with one Forest,
  draw 7, "exactly 3" gives K=1, k=3.
- n - k > N - K, where drawing k targets would need more non-target cards than
  exist. An 8-card deck with 6 targets, draw 5, "exactly 0" gives N-K=2, n-k=5.

Both are reachable: the quantity and drawn spinboxes allow 1-60, and the
"at least" branch caps k at copies while the "exactly" branch passes the spinbox
value straight through.

Extract the function so it can be tested on its own, and guard both cases.
Restoring the old guard fails 3 of the 7 new tests.
2026-10-10 19:57:18 +02:00
..
resources [Themes] Encode home backgrounds as JPEG to slim the repo (#7346) 2026-09-24 18:40:04 +02:00
sounds Add cmake format (#4618) 2022-05-08 21:22:43 +02:00
src [Analytics] Return zero instead of NaN for impossible draw probabilities 2026-10-10 19:57:18 +02:00
themes [Themes] Encode home backgrounds as JPEG to slim the repo (#7346) 2026-09-24 18:40:04 +02:00
translations Update translation files (#7044) 2026-07-16 09:07:33 +02:00
.qdevelop icon_draw and icon_untap added, icon_general and icon_messages modified 2009-07-31 13:37:16 +02:00
CMakeLists.txt [Analytics] Return zero instead of NaN for impossible draw probabilities 2026-10-10 19:57:18 +02:00
cockatrice-cod.xml Define Cockatrice as an editor/handler for .cod files and cockatrice:// protocol on all platforms (#6775) 2026-08-08 19:02:19 +02:00
cockatrice.desktop fix the desktop file, removing the invalid key (#7406) 2026-10-10 17:15:10 +02:00
cockatrice.qrc [Themes] Encode home backgrounds as JPEG to slim the repo (#7346) 2026-09-24 18:40:04 +02:00
cockatrice.rc Included uninstaller for Windows version 2010-09-17 15:26:07 +02:00
cockatrice_en@source.ts Update translation source strings (#7397) 2026-10-04 21:08:47 +02:00