Talk:Miller–Rabin primality test: Difference between revisions

→‎Run Basic and PureBasic problems with output: Kung Pow: A Fistful of Overflows
(→‎Run Basic and PureBasic problems with output: Kung Pow: A Fistful of Overflows)
Line 61:
 
:::: The PureBasic code returns these primes from 4-100: 5, 7, 11, 13, 17, 19, 23, 29, 37, 41, 73, 97. I'm not sure where it is going wrong. EDIT: it appears PureBasic is overflowing when doing the Pow(). PS- sorry I'm new here I hope you don't mind me editing the heading [[User:Bearded badger|Bearded badger]] ([[User talk:Bearded badger|talk]])
 
::::: Given n = 31, if we select a base of 22 then it does x = (22^15) % 31 and gets -8 as the result (instead of 30 = n-1). Similar with base 27. The Pow operation overflows very easily, so the program isn't very useful as written. It needs a powmod using a ladder (see the C deterministic code or the Go code, for examples). [[User:Danaj|Danaj]] ([[User talk:Danaj|talk]]) 07:22, 12 March 2016 (UTC)
Anonymous user