I'm not sure they are exactly the same, but don't quote me on it.
Here was my test:
const float2 r = float2(
23.1406926327792690, // e^pi (Gelfond's constant)
2.6651441426902251); // 2^sqrt(2) (Gelfond–Schneider constant)
return frac( cos( fmod( 12345678., 1e-7 + 256. * dot(p,r) ) ) );
//return frac( cos( 12345678.% (1e-7 + 256. * dot(p,r)) ) );
The 2nd version returns visual patterns when mapped as a texture whereas the 1st appears purely random.
Perhaps I'm misunderstanding something but they certainly seem to act differently in this instance.
Maybe I just foofed the test but thought I would mention it as it seemed relevant.
EDIT: This code originated from here
Can I generate a random number inside a pixel shader? seemingly.