Dutch PHP Conference 2025 - Call For Papers

gmp_binomial

(PHP 7 >= 7.3.0, PHP 8)

gmp_binomialCalculates binomial coefficient

Опис

gmp_binomial(GMP|int|string $n, int $k): GMP

Calculates the binomial coefficient C(n, k).

Параметри

n

GMP-номер типу resource в PHP 5.5 та старіших версіях, об'єкт GMP в PHP 5.6 та новіших, або ж числовий рядок за можливості перетворення останнього на число.

k

Значення, що повертаються

Returns the binomial coefficient C(n, k).

Помилки/виключення

Throws ValueError if k is negative. Prior to PHP 8.0.0, E_WARNING was issued instead.

Журнал змін

Версія Опис
8.0.0 This function no longer returns false on failure.
add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top