Some perfect_square_p experiments

jason jason at insomnia247.nl
Wed Mar 20 00:15:48 CET 2024


Oh, just a follow-on, here's a small perfect hash function
for quadratic residues modulo 256.  It does the same thing
as the sq_res_100[] table.

static bool mod256(unsigned x)
{
	x %= 256;
	return !(x*0x105fd & ~(x*0x502a8) & 0xff14082a);
}


More information about the gmp-devel mailing list