closestTo

fun closestTo(reference: Double, v1: Double, v2: Double): Double

Return

v1 if val is closer to v1 than to v2, v2 otherwise

Parameters

reference

the value

v1

first value to compare to

v2

second value to compare to