Difference between revisions of "Big Mod Algorithm"
Jump to navigation
Jump to search
(Created page with "https://golammostaeen.wordpress.com/2012/10/20/big-mod-algorithm/ <math>a^b % p = a^(b%(p-1)) % p</math> เพราะว่ามันจะ cycle ค่า mod ทุ...") |
(No difference)
|
Latest revision as of 00:15, 8 March 2019
https://golammostaeen.wordpress.com/2012/10/20/big-mod-algorithm/ <math>a^b % p = a^(b%(p-1)) % p</math> เพราะว่ามันจะ cycle ค่า mod ทุก p 0..p-1 จะได้ค่า mod = p..2p-2
ถ้า
a^b % p กรณีที่ p ไม่ใช่ prime ถ้า a กับ p เป็น co prime ใช้ euler method