truncate

inline fun <T : Number> Array<T>.truncate(): DoubleArray

Rounds the given value Array to an integer towards zero.

Example:

arrayOf(1.1, 1.49998, 2.99996, 2.6).truncate() // [1.0, 1.0, 2.0, 2.0]

Since

1.1.0

See also

truncate

inline fun <T : Number> Iterable<T>.truncate(): Iterable<Double>

Rounds the given value Iterable to an integer towards zero.

Example:

listOf(1.1, 1.49998, 2.99996, 2.6).truncate() // [1.0, 1.0, 2.0, 2.0]

Since

1.1.0

See also

truncate