On Fri, 23 Sep 2005, Marcin Tustin wrote: > Thanks for this: All I have to do now is fix the fact that my maths is stupidly screwed! 'div' is the integer division and rounds down. You should either use Rational (or Double) everywhere or use % which builds a ratio from two integers.