public Rational root(BigInteger r) throws NumberFormatException
        {
                /* test for overflow */
                if ( r.compareTo(MAX_INT) == 1 )
                        throw new NumberFormatException("Root "+r.toString()+" too large.") ;
                if ( r.compareTo(MIN_INT) == -1 )
                        throw new NumberFormatException("Root "+r.toString()+" too small.") ;

                int rthroot = r.intValue() ;
                /* cannot pull root of a negative value with even-valued root */
                if ( compareTo(ZERO) == -1 && (rthroot % 2) ==0 )
                        throw new NumberFormatException("Negative basis "+ toString()+" with odd root "+r.toString()) ;

                /* extract a sign such that we calculate |n|^(1/r), still r carrying any sign
                */
                final boolean flipsign = ( compareTo(ZERO) == -1 && (rthroot % 2) != 0) ? true : false ; 

                /* delegate the main work to ifactor#root()
                */
                Ifactor num =  new Ifactor(a.abs()) ;
                Ifactor deno = new Ifactor(b) ;
                final Rational resul = num.root(rthroot).divide( deno.root(rthroot) ) ;
                if ( flipsign)
                        return resul.negate() ;
                else
                        return resul ;
        } /* Rational.root */