Files
C-Plus-Plus/math/ncr_modulo_p.cpp
Piotr Idzik af72fab013 fix: make interface of NCRModuloP fail-safe (#2469)
* fix: set proper size of fac

* style: use std::size_t as a type of loop counter

* style: use uint64_t as a type of loop counter

* fix: remove p from the argument list of NCRModuloP::ncr

* refactor: add utils namespace

* refactor: use references in gcdExtended

* refactor: add NCRModuloP::computeFactorialsMod

* style: make NCRModuloP::ncr const

* test: reorganize tests

* test: add missing test cases

* refactor: simplify logic

* style: make example object const

* style: use auto

* style: use int64_t to avoid narrowing conversions

* docs: update explanation why to import iostream

* docs: remove `p` from docstr of `NCRModuloP::ncr`

* docs: udpate doc-strs and add example()

* Apply suggestions from code review

Co-authored-by: David Leal <halfpacho@gmail.com>

* dosc: add missing docs

* feat: display message when all tests pass

Co-authored-by: David Leal <halfpacho@gmail.com>

* style: initialize `NCRModuloP::p` with `0`

Co-authored-by: David Leal <halfpacho@gmail.com>

---------

Co-authored-by: David Leal <halfpacho@gmail.com>
Co-authored-by: realstealthninja <68815218+realstealthninja@users.noreply.github.com>
2024-08-31 06:12:39 +05:30

5.9 KiB