Package: java.lang

## Class Float

- - ### Methods Summary

    Methods
    Return type | Name and parameters
    --- | ---
    `float` | `abs()` Get the absolute value
    `boolean` | `asBoolean()` Coerce a Float instance to a boolean value.
    `void` | `downto(Number to, Closure closure)` Iterates from this number down to the given number, inclusive, decrementing by one each time.
    `boolean` | `equalsIgnoreZeroSign(Object other)` Compares this object against the specified object returning the same result as Float#equals(Object) but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.
    `int` | `round()` Round the value
    `float` | `round(int precision)` Round the value
    `float` | `trunc()` Truncate the value
    `float` | `trunc(int precision)` Truncate the value
    `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`, `isNotCase`, `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`, `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`, `split`, `sprintf`, `sprintf`, `stream`, `tap`, `toString`, `use`, `use`, `use`, `with`, `with`, `withCloseable`, `withStream`, `withTraits`

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

    `numberAwareCompareTo`

- - ### Methods Detail

    - #### public float abs()

      Get the absolute value

      Returns:
        the absolute value of that Float
      Since:
        1.0

    - #### public boolean asBoolean()

      Coerce a Float 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 Float#equals(Object) but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.

      Parameters:
      Since:
        3.0.8

    - #### public int round()

      Round the value

      Returns:
        the rounded value of that Float
      Since:
        1.0

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

      Round the value

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

    - #### public float trunc()

      Truncate the value

      Returns:
        the Float truncated to 0 decimal places
      Since:
        1.6.0

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

      Truncate the value

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

    - #### 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