Represents the interval between two number, The interval can be either open, closed, or half closed, ie. either including or excluding the endpoint values

Constructors

  • Creates a new interval.

    Parameters

    • min: number

      The minimum endpoint of the interval

    • max: number

      The maximum endpoint of the interval.

    • intervalType: IntervalType = IntervalType.Closed

      The type of interval, default is closed.

    Returns Interval

Properties

includeMax: boolean
includeMin: boolean
intervalType: IntervalType = IntervalType.Closed

The type of interval, default is closed.

max: number

The maximum endpoint of the interval.

min: number

The minimum endpoint of the interval

Methods

  • Checks if the given value is contained in the interval or not.

    Parameters

    • val: number

      Value to check if it is contained.

    Returns boolean

Generated using TypeDoc