Skip to content

math/big: modInverse doesn't require a prime modulus #8875

@randall77

Description

@randall77
The spec of math/big.modInverse requires the modulus to be prime.  But the inverse is
well defined as long as the number being inverted and the modulus are relatively prime. 
Perhaps more importantly, the current code seems to work for all of those cases.

Should we relax the spec to include these cases?
Any reason why the current code wouldn't always work with this relaxation?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions