// Date: 08-04-14 Khu

package Pairs;
// Only to be used for extensions of PairWithGcd.

public class PairWithGcdR extends PairWithGcd
{ 
	public int gcd ()
        {
		if (q == 0)
                {
			return Math.abs(p);
		}
                else
                {
			PairWithGcdR next = new PairWithGcdR(q, p % q);
			return next.gcd();
		}
	}

	public PairWithGcdR (int newP, int newQ)
        {
		set(newP, newQ);
	}
}
