mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 13:53:55 -07:00
cppchecker
This commit is contained in:
parent
99dcb8122a
commit
59cd54e178
1 changed files with 6 additions and 2 deletions
|
@ -660,10 +660,14 @@ static double p_hypergeometric(uint16_t i_K, uint16_t n, uint16_t k) {
|
||||||
if (n - k == N - K) { // special case. The published recursion below would fail with a divide by zero exception
|
if (n - k == N - K) { // special case. The published recursion below would fail with a divide by zero exception
|
||||||
double log_result = 0.0;
|
double log_result = 0.0;
|
||||||
for (int16_t i = k + 1; i <= n; i++) {
|
for (int16_t i = k + 1; i <= n; i++) {
|
||||||
log_result += log(i);
|
if (i) {
|
||||||
|
log_result += log(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
for (int16_t i = K + 1; i <= N; i++) {
|
for (int16_t i = K + 1; i <= N; i++) {
|
||||||
log_result -= log(i);
|
if (i) {
|
||||||
|
log_result -= log(i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return exp(log_result);
|
return exp(log_result);
|
||||||
} else { // recursion
|
} else { // recursion
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue