NumericRange

object NumericRange

A companion object for numeric ranges.

A companion object for numeric ranges.

Companion
class
class Object
trait Matchable
class Any

Type members

Classlikes

class Exclusive[T](start: T, end: T, step: T)(num: Integral[T]) extends NumericRange[T]
class Inclusive[T](start: T, end: T, step: T)(num: Integral[T]) extends NumericRange[T]

Value members

Concrete methods

def apply[T](start: T, end: T, step: T)(num: Integral[T]): Exclusive[T]
def count[T](start: T, end: T, step: T, isInclusive: Boolean)(num: Integral[T]): Int

Calculates the number of elements in a range given start, end, step, and whether or not it is inclusive.

Calculates the number of elements in a range given start, end, step, and whether or not it is inclusive. Throws an exception if step == 0 or the number of elements exceeds the maximum Int.

def inclusive[T](start: T, end: T, step: T)(num: Integral[T]): Inclusive[T]