emulation of Fp::inv