distance

fun distance(other: Range): Int

Returns the closest distance between this and the given range.

When range 1 ends at 0x1000 and range 2 starts at 0x1002, the distance between them is 1. If the range 2 starts at 0x0001, the distance is 0 and they can be merged. If ranges overlap each other, the distance is 0.

Return

The distance between ranges in units.

Parameters

other

The range to check distance to.