pModInv
Calculate the modular inverse of a given integer, which is the inverse of this integer modulo p.
Uses the ModExp precompiled contract at address 0x05 for fast computation using little Fermat theorem
function pModInv(uint256 self) returns (uint256 result);
Parameters
Name | Type | Description |
---|---|---|
self | uint256 | The integer of which to find the modular inverse |
Returns
Name | Type | Description |
---|---|---|
result | uint256 | The modular inverse of the input integer. If the modular inverse doesn't exist, it revert the tx |