compare

open fun compare(a: Double, b: Double): Int(source)

Compares two double values considering the defined precision. This is an approximate comparison, not a total order: do not use it as the comparator of a sorted collection.

Return

0 if the values are considered equal, -1 if a is less than b, and 1 if a is greater than b.

Parameters

a

The first double value to compare.

b

The second double value to compare.