Enchanting/Levels

The minimum values are all calculated using a linear function y = kx+m 	where y is the calculated minimum value, x is the current enchantment power level and k and m varies between different enchantments. The maximum values are all the minimum values plus a constant that varies for each enchantment.


 * WARNING* Minecraft 1.4 has only up to 30 enchanting levels - THIS MAY MEAN THAT IT WILL NOT BE 100% RIGHT

Source:

Note: that extremely high modified enchantment levels can fall outside the ranges of all valid enchantments for the item. If this happens, the item is left un-enchanted, but you are not charged any experience levels and can try enchanting it again.