Skip to content

Added BigUInt::factorial - #229

Open
PatrickNorton wants to merge 3 commits into
rust-num:mainfrom
PatrickNorton:factorial
Open

Added BigUInt::factorial#229
PatrickNorton wants to merge 3 commits into
rust-num:mainfrom
PatrickNorton:factorial

Conversation

@PatrickNorton

Copy link
Copy Markdown
Contributor

No description provided.

Comment thread src/biguint/factorial.rs Outdated
Co-authored-by: pierwill <19642016+pierwill@users.noreply.github.com>
Comment thread src/biguint.rs
Comment on lines +961 to +962
// usize::MAX! > 2**usize::MAX, so just error w/o running the system out of memory
match self.to_usize() {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The growth of x! is similar to x**x, so the input should be constrained to less than half the bit-width (usize::MAX.isqrt()) or 1 << (usize::BITS / 2)))

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants