commonMain.io.nacular.doodle.utils.Ranges.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of core-jvm Show documentation
Show all versions of core-jvm Show documentation
A pure Kotlin, UI framework for the Web and Desktop
package io.nacular.doodle.utils
/**
* Created by Nicholas Eddy on 2/12/18.
*/
public infix fun > ClosedRange.intersect (other: ClosedRange): ClosedRange = maxOf(start, other.start) .. minOf(endInclusive, other.endInclusive)
public infix fun > ClosedRange.intersects(other: ClosedRange): Boolean = start in other || endInclusive in other
public val ClosedRange.size: Int get() = endInclusive - start
public val ClosedRange.size: Double get() = endInclusive - start
public val ClosedRange.size: Float get() = endInclusive - start
© 2015 - 2025 Weber Informatics LLC | Privacy Policy