Package: java.math

## Class BigDecimal

- - ### Methods Summary

    Methods
    Return type | Name and parameters
    --- | ---
    `void` | `downto(Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `Number` | `multiply(Double right)` Multiply a BigDecimal and a Double.
    `Number` | `multiply(BigInteger right)` Multiply a BigDecimal and a BigInteger.
    `Number` | `power(Integer exponent)` Power of a BigDecimal to an integer certain exponent.
    `void` | `upto(Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.

  - #### Methods inherited from class java.lang.Number

    `abs`, `and`, `asBoolean`, `asType`, `bitwiseNegate`, `compareTo`, `compareTo`, `div`, `div`, `downto`, `intdiv`, `intdiv`, `isCase`, `leftShift`, `minus`, `minus`, `mod`, `multiply`, `multiply`, `next`, `or`, `plus`, `plus`, `plus`, `power`, `previous`, `rightShift`, `rightShiftUnsigned`, `step`, `times`, `toBigDecimal`, `toBigInteger`, `toDouble`, `toFloat`, `toInteger`, `toLong`, `unaryMinus`, `unaryPlus`, `upto`, `xor`

  - #### Methods inherited from class java.lang.Object

    `addShutdownHook`, `any`, `any`, `asBoolean`, `asType`, `collect`, `collect`, `collect`, `contains`, `count`, `dump`, `each`, `eachWithIndex`, `equals`, `every`, `every`, `find`, `find`, `findAll`, `findAll`, `findIndexOf`, `findIndexOf`, `findIndexValues`, `findIndexValues`, `findLastIndexOf`, `findLastIndexOf`, `findResult`, `findResult`, `flatten`, `getAt`, `getMetaClass`, `getMetaPropertyValues`, `getProperties`, `grep`, `grep`, `groupBy`, `groupBy`, `hasProperty`, `identity`, `inject`, `inject`, `inspect`, `invokeMethod`, `is`, `isCase`, `iterator`, `join`, `metaClass`, `print`, `print`, `printf`, `printf`, `println`, `println`, `println`, `putAt`, `respondsTo`, `respondsTo`, `setMetaClass`, `size`, `split`, `sprintf`, `sprintf`, `sum`, `sum`, `sum`, `sum`, `toArrayString`, `toSpreadMap`, `toString`, `use`, `use`, `use`, `with`, `withTraits`

  - #### Methods inherited from interface java.lang.Comparable

    `numberAwareCompareTo`

- - ### Methods Detail

    - #### public void downto(Number to, Closure closure)

      Iterates from this number down to the given number, inclusive, decrementing by one each time. Each number is passed to the closure. Example:

          10.5.downto(0) {
            println it
          }

      Prints numbers 10.5, 9.5 ... to 0.5.
      Parameters:
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public Number multiply(Double right)

      Multiply a BigDecimal and a Double. Note: This method was added to enforce the Groovy rule of BigDecimal*Double == Double. Without this method, the multiply(BigDecimal) method in BigDecimal would respond and return a BigDecimal instead. Since BigDecimal is preferred over Number, the Number*Number method is not chosen as in older versions of Groovy.

      Parameters:
        `right` - a Double
      Returns:
        the multiplication of left by right
      Since:
        1.0

    - #### public Number multiply(BigInteger right)

      Multiply a BigDecimal and a BigInteger. Note: This method was added to enforce the Groovy rule of BigDecimal*long == long. Without this method, the multiply(BigDecimal) method in BigDecimal would respond and return a BigDecimal instead. Since BigDecimal is preferred over Number, the Number*Number method is not chosen as in older versions of Groovy. BigInteger is the fallback for all integer types in Groovy

      Parameters:
        `right` - a BigInteger
      Returns:
        the multiplication of left by right
      Since:
        1.0

    - #### public Number power(Integer exponent)

      Power of a BigDecimal to an integer certain exponent. If the exponent is positive, call the BigDecimal.pow(int) method to maintain precision. Called by the '**' operator.

      Parameters:
        `exponent` - an Integer exponent
      Returns:
        a Number to the power of a the exponent

    - #### public void upto(Number to, Closure closure)

      Iterates from this number up to the given number, inclusive, incrementing by one each time.

          0.1.upto( 10 ) {
            println it
          }

      Prints numbers 0.1, 1.1, 2.1... to 9.1
      Parameters:
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0