Skip to content

Missing BigInt::pow() + BigUInt::pow() #46

@JamesMcGuigan

Description

@JamesMcGuigan

There are a number of missing functions when comparing num-bigint-dig with num-bigint.

The most noticeable is BigInt::pow(), which is strange because BigInt::modpow() is implemented.

use num_traits::{Num, One, Pow, Signed, Zero};
impl BigInt {
    /// Returns `self ^ exponent`.
    pub fn pow(&self, exponent: u32) -> Self {
        Pow::pow(self, exponent)
    }
}

Unsure how far the codebases have diverged, but it might be worth doing an API review between the two projects (ideally num-bigint-dig should be a drop-in replacement for num-bigint) and potentially performing an unstream merge for any safe new features since the original fork.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions