#if !defined HAVE_TESTNUM_H__
#define      HAVE_TESTNUM_H__


#include "sort/bsearch.h"
#include "fxttypes.h"

// mod/testnum.cc:
extern const ulong idoneal_tab[];
extern const ulong idoneal_tab_sz;
extern const ulong npqr_tab[];
extern const ulong npqr_tab_sz;

inline bool is_idoneal(ulong x)
// Return true if the number x is idoneal
{
    ulong idx = bsearch(idoneal_tab, idoneal_tab_sz, x);
    return  (~0UL != idx);
}
// -------------------------


inline ulong is_npqr(ulong x)
// Return true if the number x is a modulus such
// that no squares mod x are primes.
{
    ulong idx = bsearch(npqr_tab, npqr_tab_sz, x);
    return  (~0UL != idx);
}
// -------------------------


#endif // !defined HAVE_TESTNUM_H__
