public static void downto(BigInteger self,Number to,@ClosureParams(FirstParam.class) Closure closure){
  if (to instanceof BigDecimal) {
    final BigDecimal one=BigDecimal.valueOf(10,1);
    final BigDecimal to1=(BigDecimal)to;
    final BigDecimal selfD=new BigDecimal(self);
    if (selfD.compareTo(to1) >= 0) {
      for (BigDecimal i=selfD; i.compareTo(to1) >= 0; i=i.subtract(one)) {
        closure.call(i.toBigInteger());
      }
    }
 else     throw new GroovyRuntimeException(MessageFormat.format("The argument ({0}) to downto() cannot be greater than the value ({1}) it''s called on.",to,self));
  }
 else   if (to instanceof BigInteger) {
    final BigInteger one=BigInteger.valueOf(1);
    final BigInteger to1=(BigInteger)to;
    if (self.compareTo(to1) >= 0) {
      for (BigInteger i=self; i.compareTo(to1) >= 0; i=i.subtract(one)) {
        closure.call(i);
      }
    }
 else     throw new GroovyRuntimeException(MessageFormat.format("The argument ({0}) to downto() cannot be greater than the value ({1}) it''s called on.",to,self));
  }
 else {
    final BigInteger one=BigInteger.valueOf(1);
    final BigInteger to1=new BigInteger(to.toString());
    if (self.compareTo(to1) >= 0) {
      for (BigInteger i=self; i.compareTo(to1) >= 0; i=i.subtract(one)) {
        closure.call(i);
      }
    }
 else     throw new GroovyRuntimeException(MessageFormat.format("The argument ({0}) to downto() cannot be greater than the value ({1}) it''s called on.",to,self));
  }
}

public static void downto ( BigInteger self , Number to , @ ClosureParams ( FirstParam . class ) Closure closure ) { if ( to instanceof BigDecimal ) { final BigDecimal one = BigDecimal . valueOf ( 10 , 1 ) ; final BigDecimal to1 = ( BigDecimal ) to ; final BigDecimal selfD = new BigDecimal ( self ) ; if ( selfD . compareTo ( to1 ) >= 0 ) { for ( BigDecimal i = selfD ; i . compareTo ( to1 ) >= 0 ; i = i . subtract ( one ) ) { closure . call ( i . toBigInteger ( ) ) ; } } else throw new GroovyRuntimeException ( MessageFormat . format ( "The argument ({0}) to downto() cannot be greater than the value ({1}) it''s called on." , to , self ) ) ; } else if ( to instanceof BigInteger ) { final BigInteger one = BigInteger . valueOf ( 1 ) ; final BigInteger to1 = ( BigInteger ) to ; if ( self . compareTo ( to1 ) >= 0 ) { for ( BigInteger i = self ; i . compareTo ( to1 ) >= 0 ; i = i . subtract ( one ) ) { closure . call ( i ) ; } } else throw new GroovyRuntimeException ( MessageFormat . format ( "The argument ({0}) to downto() cannot be greater than the value ({1}) it''s called on." , to , self ) ) ; } else { final BigInteger one = BigInteger . valueOf ( 1 ) ; final BigInteger to1 = new BigInteger ( to . toString ( ) ) ; if ( self . compareTo ( to1 ) >= 0 ) { for ( BigInteger i = self ; i . compareTo ( to1 ) >= 0 ; i = i . subtract ( one ) ) { closure . call ( i ) ; } } else throw new GroovyRuntimeException ( MessageFormat . format ( "The argument ({0}) to downto() cannot be greater than the value ({1}) it''s called on." , to , self ) ) ; } }
iterates from this number down to the given number , inclusive , decrementing by one each time .
