It'll be interesting to see how well that performs and what limitations it has. (Are denominator and numerator limited to ivsize ?) Perl5 does provide access to rational arithmetic via Math::BigRat (which is slow) and Math::GMPq (which is fast, but requires the gmp library).