Add sample for coerceIn with floating point range

#KT-20357
This commit is contained in:
Ilya Gorbunov
2018-01-10 18:04:36 +03:00
parent 8fc83e3ff5
commit 6197c5bf7f
5 changed files with 12 additions and 0 deletions
@@ -640,6 +640,7 @@ public expect fun Double.coerceIn(minimumValue: Double, maximumValue: Double): D
* Ensures that this value lies in the specified [range].
*
* @return this value if it's in the [range], or `range.start` if this value is less than `range.start`, or `range.endInclusive` if this value is greater than `range.endInclusive`.
* @sample samples.comparisons.ComparableOps.coerceInFloatingPointRange
*/
@SinceKotlin("1.1")
public expect fun <T: Comparable<T>> T.coerceIn(range: ClosedFloatingPointRange<T>): T