Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

php
gmp_binomial
communitycreator

What is gmp_binomial in PHP?

Hammad Nasir

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

gmp_binomial is a function in PHP that calculates the binomial coefficient.

Syntax


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

Parameters

  • n: can be a numeric string, GMP object, or type int.

  • k: number of combinations.

Return value

The function returns the binomial coefficient C(n,k)C(n,k).

Code

<?php
$result = gmp_binomial('4',2);
echo "The binomial coefficient of the result is ".$result;
?>

Output


The binomial coefficient of the result is 6

RELATED TAGS

php
gmp_binomial
communitycreator

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring