Ah. Yes, it seems broken that Gmp.mpz->pow accepts floats when it just truncates the input and then does integer math.
If you use pow() instead of Gmp.mpz->pow() (4->pow(), in your example) this flaw won't bite you until your base is too large not to fit in a machine native signed integer: (example from my machine)
pow( (1<<31) - 1, 0.5 );
(1) Result: 46340.949219
pow( 1<<31, 0.5 );
(2) Result: 1