Add sample for coerceIn with floating point range
#KT-20357
This commit is contained in:
@@ -889,6 +889,7 @@ public fun Double.coerceIn(minimumValue: Double, maximumValue: Double): Double {
|
||||
* 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 fun <T: Comparable<T>> T.coerceIn(range: ClosedFloatingPointRange<T>): T {
|
||||
|
||||
Reference in New Issue
Block a user