/* See mod_int.pxd if you want to use these declarations in Cython */12/* CPython using signed long as the data type for plain integers, which is3* - 8 bytes on 64-bit Linux and OSX4* - 4 bytes on 64-bit Windows and all 32-bit supported platforms.5* If you want to convert mod_int quickly to Python, then it must fit6* into such an integer. Otherwise you'll end up with Python's7* arbitrary-size integers instead of machine ints.8*9* However, 4 bytes is rather small and one can quickly run out of10* primes, especially if the problem has many bad primes. See Trac11* #10281 for details.12*13* Hence, we use signed 64-bit ints. This gives us fast conversion14* to/from Python on 64-bit Linux and OSX, and a large number of15* available (but not quite as fast) primes on 64-bit Windows and all16* 32-bit platforms (see Trac ##10281)17*/18#define mod_int int_fast64_t1920/* The largest value we can do arithmetic on without risking overflowing.21* That is, you can multiply two MOD_INT_MAX in a mod_int.22*/23#define MOD_INT_OVERFLOW ((((mod_int)1) << (sizeof(mod_int)*8 - 1)) - 1)24#define MOD_INT_MAX ((mod_int)sqrt(MOD_INT_OVERFLOW) - 1)25262728