# Mathematics

> Section in “New and Extended Functionality” of the book [PHP 7 Explained](https://php7explained.com/) by Sebastian Bergmann and Stefan Priebsch, published by thePHP.cc. The book covers PHP 7.0 to 7.4 and was last updated in November 2020. HTML version: <https://php7explained.com/new-and-extended-functionality/mathematics/>

## In this section

- [Consistent 64-bit Support](https://php7explained.com/new-and-extended-functionality/mathematics/consistent-64-bit-support/index.html.md): PHP 7 supports native 64-bit integers on Windows and handles integer size and string length consistently on LP64, LLP64, and ILP64 platforms.
- [Integer Division](https://php7explained.com/new-and-extended-functionality/mathematics/integer-division/index.html.md): PHP 7 adds intdiv() for integer division, which returns an integer and throws DivisionByZeroError or ArithmeticError instead of losing precision.
- [gmp_random_seed()](https://php7explained.com/new-and-extended-functionality/mathematics/gmp_random_seed/index.html.md): With gmp_random_seed(), new in PHP 7, the GMP functions gmp_random(), gmp_random_bits(), and gmp_random_range() can be seeded for reproducible sequences.
- [gmp_binomial()](https://php7explained.com/new-and-extended-functionality/mathematics/gmp_binomial/index.html.md): The gmp_binomial() function calculates binomial coefficients and returns the result as a GMP object, shown with gmp_binomial(49, 6) as an example.
- [gmp_kronecker()](https://php7explained.com/new-and-extended-functionality/mathematics/gmp_kronecker/index.html.md): The gmp_kronecker() function calculates the Kronecker symbol of two numbers and returns it as an integer, for example -1 for gmp_kronecker(23, 12).
- [gmp_lcm()](https://php7explained.com/new-and-extended-functionality/mathematics/gmp_lcm/index.html.md): The gmp_lcm() function calculates the least common multiple of two numbers and returns it as a GMP object, for example 12 for gmp_lcm(4, 6).
- [gmp_perfect_power()](https://php7explained.com/new-and-extended-functionality/mathematics/gmp_perfect_power/index.html.md): The gmp_perfect_power() function checks whether a number is a perfect power and returns a boolean: true for 8 and false for 7 in the example shown.

---

Previous: [Spread Operator in Array Expressions](https://php7explained.com/new-and-extended-functionality/arrays/spread-operator-in-array-expressions/index.html.md) | Next: [Consistent 64-bit Support](https://php7explained.com/new-and-extended-functionality/mathematics/consistent-64-bit-support/index.html.md)
