Package: java.lang

## [Java] Class Double

- java.lang.Double

-     public class Double
      extends Object

  GDK enhancements for Double.

  displayName:
    Double
  receiverFqcn:
    java.lang.Double

- - ### Methods Summary

    Methods
    Type Params | Return Type | Name and description
    --- | --- | ---
    `` | `public double` | `abs()` Gets the absolute value.
    `` | `public boolean` | `asBoolean()` Coerce a Double instance to a boolean value.
    `` | `public void` | `downto(Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `` | `public boolean` | `equalsIgnoreZeroSign(Object other)` Compares this object against the specified object returning the same result as Double.equals but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.
    `` | `public long` | `round()` Round the value
    `` | `public double` | `round(int precision)` Round the value
    `` | `public double` | `trunc()` Truncate the value
    `` | `public double` | `trunc(int precision)` Truncate the value
    `` | `public void` | `upto(Number to, Closure closure)` Iterates from this number up to the given number, inclusive, incrementing by one each time.

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class Object` | `addShutdownHook, any, any, asBoolean, asType, collect, collect, collect, dump, each, eachMatch, eachMatch, eachWithIndex, every, every, find, find, findAll, findAll, findIndexOf, findIndexOf, findIndexValues, findIndexValues, findLastIndexOf, findLastIndexOf, findResult, findResult, findResult, findResult, getAt, getMetaClass, getMetaPropertyValues, getProperties, grep, grep, hasProperty, identity, inject, inject, inspect, invokeMethod, is, isCase, isNotCase, iterator, metaClass, print, print, printf, printf, println, println, println, putAt, respondsTo, respondsTo, setMetaClass, sleep, sleep, split, sprintf, sprintf, stream, tap, toString, use, use, use, with, with, withCloseable, withCloseable, withMethodClosure, withStream, withStream, withTraits`

- - ### Method Detail

    - #### public double abs()

      Gets the absolute value.

      Returns:
        the absolute value of that Double
      Since:
        1.0

    - #### public boolean asBoolean()

      Coerce a Double instance to a boolean value.

      Returns:
        `true` for non-zero and non-NaN values, else `false`
      Since:
        2.6.0

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

      Iterates from this number down to the given number, inclusive, decrementing by one each time.

      Parameters:
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0

    - #### public boolean equalsIgnoreZeroSign(Object other)

      Compares this object against the specified object returning the same result as Double.equals but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.

      Since:
        3.0.8

    - #### public long round()

      Round the value

      Returns:
        the rounded value of that Double
      Since:
        1.0

    - #### public double round(int precision)

      Round the value

      Parameters:
        `precision` - the number of decimal places to keep
      Returns:
        the Double rounded to the number of decimal places specified by precision
      Since:
        1.6.4

    - #### public double trunc()

      Truncate the value

      Returns:
        the Double truncated to 0 decimal places
      Since:
        1.6.4

    - #### public double trunc(int precision)

      Truncate the value

      Parameters:
        `precision` - the number of decimal places to keep
      Returns:
        the Double truncated to the number of decimal places specified by precision
      Since:
        1.6.4

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

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

      Parameters:
        `to` - the end number
        `closure` - the code to execute for each number
      Since:
        1.0