abc/src/misc/util/abc_global.h
// Returns the next prime >= p
Returns the next prime >= p
Returns the next prime > = p
static inline int Abc_PrimeCudd( unsigned int p )
{
    int i,pn;
    p--;
    do {
        p++;
        if (p&1)
        {
            pn = 1;
            i = 3;
            while ((unsigned) (i * i) <= p)
            {
                if (p % i == 0) {
                    pn = 0;
                    break;
                }
                i += 2;
            }
        }
        else
            pn = 0;
    } while (!pn);
    return(p);
}
static inline int Abc_PrimeCudd ( unsigned int p ) { int i , pn ; p -- ; do { p ++ ; if ( p & 1 ) { pn = 1 ; i = 3 ; while ( ( unsigned ) ( i * i ) <= p ) { if ( p % i == 0 ) { pn = 0 ; break ; } i += 2 ; } } else pn = 0 ; } while ( ! pn ) ; return ( p ) ; }
Returns the next prime >= p
Returns the next prime > = p