IntRange


Declaration

[Serializable]
public struct IntRange : INumberRange<int>, IRange<int>

Description

A range of int values.

Static Properties

zeroShorthand for writing IntRange(0, 0).
oneShorthand for writing IntRange(1, 1).
positiveShorthand for writing IntRange(0, int.MaxValue).
negativeShorthand for writing IntRange(int.MinValue, 0).
minMaxShorthand for writing IntRange(int.MinValue, int.MaxValue).

Properties

minThe lower bound of the range.
maxThe upper bound of the range.
DeltaThe difference between the maximum and minimum values (Read only).
MedianThe median value of the range (Read only).

Constructors

IntRangeCreates a new range with the specified values.

Methods

RandomReturns a random value in the range [inclusive, exclusive).
RandomInclusiveReturns a random value in the range [inclusive, inclusive].
IncludesChecks if a value is in the range.
ClampClamps a value to the range.
LerpLinearly interpolates between the range by t.
InverseLerpCalculates the linear parameter t that produces the interpolant value within the range.