Sigrid Solveig Haflínudóttirmp: abort instead of exit, no printout5049eb811 months agoHistory
17 lines · 297 B · C
RawDownload
#include "platform.h"#include "mp.h" // use extended gcd to find the multiplicative inverse// res = b**-1 mod mvoidmpinvert(mpint *b, mpint *m, mpint *res){	mpint *v; 	v = mpnew(0);	mpextendedgcd(b, m, v, res, nil);	if(mpcmp(v, mpone) != 0)		abort();	mpfree(v);	mpmod(res, m, res);}

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t