public static uint Inverse (uint n) { uint y = n, z; while ((z = n * y) != 1) y *= 2 - z; return (uint)-y; }