note 33057 added to function.gmp-gcdext
| From: | FatPhil at rack1 dot php dot net | Date: | Sun, 15 Jun 2003 11:47:13 +0000 |
| Subject: | note 33057 added to function.gmp-gcdext | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-50374@lists.php.net to get a copy of this message | ||
The extended GCD can be used to calculate mutual modular inverses of two
coprime numbers. Internally gmp_invert uses this extended GCD routine,
but effectively throws away one of the inverses.
If gcd(a,b)=1, then r.a+s.b=1
Therefore r.a == 1 (mod s) and s.b == 1 (mod r)
Note that one of r and s will be negative, and so you'll want to
canonicalise it.
----
Manual Page -- http://www.php.net/manual/en/function.gmp-gcdext.php
Edit Note -- http://master.php.net/manage/user-notes.php?action=edit+33057
Delete Note -- http://master.php.net/manage/user-notes.php?action=delete+33057&report=yes
Reject Note -- http://master.php.net/manage/user-notes.php?action=reject+33057&report=yes