limit_denominator to prevent overflow