modinv(x, N)

Computes multiplicative inverse of x modulo N


Updated 27 Apr 2009

View License

Using variable precision integers, computes y such that
mod(x*y, N) == 1 is TRUE.

Cite As

Steven Gregory (2023). modinv(x, N) (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2006a
Compatible with any release
Platform Compatibility
Windows macOS Linux

Inspired by: nextperm, logmod

Inspired: logmod, nextperm, egcd.m

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

Rewrote the code to exploit (the new) VPIs matrix-related functions.