I'm confused how to accomplish this: ``` open ...
# announcements
b
I'm confused how to accomplish this:
Copy code
open fun contains(value: NumberType): Boolean = when (value) {
        is Number -> when {
            value.isNaN -> false
            value.isNegativeInfinity -> startInclusive == null
            value.isPositiveInfinity -> endInclusive == null
            else -> continue // Compile error: 'break' and 'continue' only allowed inside a loop
        }
        else -> when {
            startInclusive != null && value < startInclusive -> false
            endInclusive != null && value > endInclusive -> false
            else -> true
        }
    }
isNaN
,
isPositiveInfinity
, and
isNegativeInfinity
are extension values on
Number
that I wrote and separately verified do work