# intersect

fun < T : Comparable < T >> ClosedRange < T >. intersect (other: ClosedRange < T >): Pair < T , T >?(source)

Computes the intersection of this range with other. Returns a pair representing the intersecting range, or null if the ranges don't overlap.

#### Return

A pair (start, end) representing the intersection, or null if no intersection exists

#### Parameters

other

The other range to intersect with

#### Type Parameters

T

The type of comparable values in the range

fun IntRange . intersect (other: IntRange ): IntRange ?(source)

Computes the intersection of this IntRange with other. Returns the intersecting range, or null if the ranges don't overlap.

#### Return

An IntRange representing the intersection, or null if no intersection exists

#### Parameters

other

The other range to intersect with

fun LongRange . intersect (other: LongRange ): LongRange ?(source)

Computes the intersection of this LongRange with other. Returns the intersecting range, or null if the ranges don't overlap.

#### Return

A LongRange representing the intersection, or null if no intersection exists

#### Parameters

other

The other range to intersect with