I changed the code a bit and it works for integers below 100 but for every odd number above 100 it returns the number as prime. I'll post the code below :-
#include<iostream>#include<math.h>...
Type: Posts; User: manny721
I changed the code a bit and it works for integers below 100 but for every odd number above 100 it returns the number as prime. I'll post the code below :-
#include<iostream>#include<math.h>...
Sorry, for begin so ambigious and tanks for the advice.
I got the pseudocode from my textbook. It is as follows:-
1) Find an odd integer 's' such that p-1=(2^r) *s.
2) Select at random a...
I made the changes u suggested but, the program is still returning all odd numbers as prime.
/* miller-rabin */
#include<iostream>
#include<stdlib.h>
#include<math.h>
Hi! I am having problems with this program, for every odd number it returns the number as prime.
here's my program
/* Miller-Rabin Primality Test * By- manny721
* 15 oct 2011
* */