public class Float
extends Object
GDK enhancements for Float.
| Type Params | Return Type | Name and description |
|---|---|---|
|
public float |
abs()Gets the absolute value. |
|
public boolean |
asBoolean()Coerce a Float 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 Float.equals but returning true if this object and the specified object are both zero and negative zero respectively or vice versa. |
|
public int |
round()Round the value |
|
public float |
round(int precision)Round the value |
|
public float |
trunc(int precision)Truncate the value |
|
public float |
trunc()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. |
| 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 |
Gets the absolute value.
Coerce a Float instance to a boolean value.
true for non-zero and non-NaN values, else falseIterates from this number down to the given number, inclusive, decrementing by one each time.
to - the end numberclosure - the code to execute for each numberCompares this object against the specified object returning the same result as Float.equals but returning true if this object and the specified object are both zero and negative zero respectively or vice versa.
Round the value
Round the value
precision - the number of decimal places to keepTruncate the value
precision - the number of decimal places to keepTruncate the value