C# Класс Loyc.Range

Contains the functions used by the Enhanced C# in, .. and ... operators... plus the handy PutInRange() methods.
Note: the following InRange extension methods have been moved to class G in Loyc.Essentials so that Loyc.Syntax can use them:
  • n.IsInRange(lo, hi) returns true if n >= lo && hi >= n, which corresponds to n in lo...hi in EC#.
  • n.IsInRangeExcludeHi(lo, hi) returns true if n >= lo && hi > n, which corresponds to n in lo..hi in EC#.
If `in` and a range operator are not used together, something slightly different happens:
  • var r = lo..hi becomes Range.ExcludeHi(lo, hi) (Range.Inclusive for ...).
  • x in r becomes r.Contains(x).
Показать файл Открыть проект

Открытые методы

Метод Описание
ExcludeHi ( FPI16 lo, FPI16 hi ) : MathFPI16>.NumRange

Returns a range from lo to hi that excludes hi by decreasing it by 1.

ExcludeHi ( FPI8 lo, FPI8 hi ) : MathFPI8>.NumRange

Returns a range from lo to hi that excludes hi by decreasing it by 1.

ExcludeHi ( double lo, double hi ) : MathD>.NumRange

Returns a range from lo to hi that excludes hi by decreasing it by 1.

ExcludeHi ( float lo, float hi ) : MathF>.NumRange

Returns a range from lo to hi that excludes hi by decreasing it by 1.

ExcludeHi ( int lo, int hi ) : MathI>.NumRange

Returns a range from lo to hi that excludes hi by decreasing it by 1.

ExcludeHi ( long lo, long hi ) : MathL>.NumRange

Returns a range from lo to hi that excludes hi by decreasing it by 1.

ExcludeHi ( uint lo, uint hi ) : MathU>.NumRange

Returns a range from lo to hi that excludes hi by decreasing it by 1.

ExcludeHi ( ulong lo, ulong hi ) : MathUL>.NumRange

Returns a range from lo to hi that excludes hi by decreasing it by 1.

Inclusive ( FPI16 lo, FPI16 hi ) : MathFPI16>.NumRange

Returns a range from lo to hi that includes both lo and hi.

Inclusive ( FPI8 lo, FPI8 hi ) : MathFPI8>.NumRange

Returns a range from lo to hi that includes both lo and hi.

Inclusive ( double lo, double hi ) : MathD>.NumRange

Returns a range from lo to hi that includes both lo and hi.

Inclusive ( float lo, float hi ) : MathF>.NumRange

Returns a range from lo to hi that includes both lo and hi.

Inclusive ( int lo, int hi ) : MathI>.NumRange

Returns a range from lo to hi that includes both lo and hi.

Inclusive ( long lo, long hi ) : MathL>.NumRange

Returns a range from lo to hi that includes both lo and hi.

Inclusive ( uint lo, uint hi ) : MathU>.NumRange

Returns a range from lo to hi that includes both lo and hi.

Inclusive ( ulong lo, ulong hi ) : MathUL>.NumRange

Returns a range from lo to hi that includes both lo and hi.

Only ( FPI16 num ) : MathFPI16>.NumRange

Returns the same range as Incl(num, num).

Only ( FPI8 num ) : MathFPI8>.NumRange

Returns the same range as Incl(num, num).

Only ( double num ) : MathD>.NumRange

Returns the same range as Incl(num, num).

Only ( float num ) : MathF>.NumRange

Returns the same range as Incl(num, num).

Only ( int num ) : MathI>.NumRange

Returns the same range as Incl(num, num).

Only ( long num ) : MathL>.NumRange

Returns the same range as Incl(num, num).

Only ( uint num ) : MathU>.NumRange

Returns the same range as Incl(num, num).

Only ( ulong num ) : MathUL>.NumRange

Returns the same range as Incl(num, num).

StartingAt ( FPI16 lo ) : MathFPI16>.NumRange

Returns a range from lo to the MaxValue of the number type.

StartingAt ( FPI8 lo ) : MathFPI8>.NumRange

Returns a range from lo to the MaxValue of the number type.

StartingAt ( double lo ) : MathD>.NumRange

Returns a range from lo to the MaxValue of the number type.

StartingAt ( float lo ) : MathF>.NumRange

Returns a range from lo to the MaxValue of the number type.

StartingAt ( int lo ) : MathI>.NumRange

Returns a range from lo to the MaxValue of the number type.

StartingAt ( long lo ) : MathL>.NumRange

Returns a range from lo to the MaxValue of the number type.

StartingAt ( uint lo ) : MathU>.NumRange

Returns a range from lo to the MaxValue of the number type.

StartingAt ( ulong lo ) : MathUL>.NumRange

Returns a range from lo to the MaxValue of the number type.

UntilExclusive ( uint hi ) : MathU>.NumRange
UntilExclusive ( ulong hi ) : MathUL>.NumRange
UntilInclusive ( uint hi ) : MathU>.NumRange
UntilInclusive ( ulong hi ) : MathUL>.NumRange

Описание методов

ExcludeHi() публичный статический Метод

Returns a range from lo to hi that excludes hi by decreasing it by 1.
public static ExcludeHi ( FPI16 lo, FPI16 hi ) : MathFPI16>.NumRange
lo FPI16
hi FPI16
Результат MathFPI16>.NumRange

ExcludeHi() публичный статический Метод

Returns a range from lo to hi that excludes hi by decreasing it by 1.
public static ExcludeHi ( FPI8 lo, FPI8 hi ) : MathFPI8>.NumRange
lo FPI8
hi FPI8
Результат MathFPI8>.NumRange

ExcludeHi() публичный статический Метод

Returns a range from lo to hi that excludes hi by decreasing it by 1.
public static ExcludeHi ( double lo, double hi ) : MathD>.NumRange
lo double
hi double
Результат MathD>.NumRange

ExcludeHi() публичный статический Метод

Returns a range from lo to hi that excludes hi by decreasing it by 1.
public static ExcludeHi ( float lo, float hi ) : MathF>.NumRange
lo float
hi float
Результат MathF>.NumRange

ExcludeHi() публичный статический Метод

Returns a range from lo to hi that excludes hi by decreasing it by 1.
public static ExcludeHi ( int lo, int hi ) : MathI>.NumRange
lo int
hi int
Результат MathI>.NumRange

ExcludeHi() публичный статический Метод

Returns a range from lo to hi that excludes hi by decreasing it by 1.
public static ExcludeHi ( long lo, long hi ) : MathL>.NumRange
lo long
hi long
Результат MathL>.NumRange

ExcludeHi() публичный статический Метод

Returns a range from lo to hi that excludes hi by decreasing it by 1.
public static ExcludeHi ( uint lo, uint hi ) : MathU>.NumRange
lo uint
hi uint
Результат MathU>.NumRange

ExcludeHi() публичный статический Метод

Returns a range from lo to hi that excludes hi by decreasing it by 1.
public static ExcludeHi ( ulong lo, ulong hi ) : MathUL>.NumRange
lo ulong
hi ulong
Результат MathUL>.NumRange

Inclusive() публичный статический Метод

Returns a range from lo to hi that includes both lo and hi.
public static Inclusive ( FPI16 lo, FPI16 hi ) : MathFPI16>.NumRange
lo FPI16
hi FPI16
Результат MathFPI16>.NumRange

Inclusive() публичный статический Метод

Returns a range from lo to hi that includes both lo and hi.
public static Inclusive ( FPI8 lo, FPI8 hi ) : MathFPI8>.NumRange
lo FPI8
hi FPI8
Результат MathFPI8>.NumRange

Inclusive() публичный статический Метод

Returns a range from lo to hi that includes both lo and hi.
public static Inclusive ( double lo, double hi ) : MathD>.NumRange
lo double
hi double
Результат MathD>.NumRange

Inclusive() публичный статический Метод

Returns a range from lo to hi that includes both lo and hi.
public static Inclusive ( float lo, float hi ) : MathF>.NumRange
lo float
hi float
Результат MathF>.NumRange

Inclusive() публичный статический Метод

Returns a range from lo to hi that includes both lo and hi.
public static Inclusive ( int lo, int hi ) : MathI>.NumRange
lo int
hi int
Результат MathI>.NumRange

Inclusive() публичный статический Метод

Returns a range from lo to hi that includes both lo and hi.
public static Inclusive ( long lo, long hi ) : MathL>.NumRange
lo long
hi long
Результат MathL>.NumRange

Inclusive() публичный статический Метод

Returns a range from lo to hi that includes both lo and hi.
public static Inclusive ( uint lo, uint hi ) : MathU>.NumRange
lo uint
hi uint
Результат MathU>.NumRange

Inclusive() публичный статический Метод

Returns a range from lo to hi that includes both lo and hi.
public static Inclusive ( ulong lo, ulong hi ) : MathUL>.NumRange
lo ulong
hi ulong
Результат MathUL>.NumRange

Only() публичный статический Метод

Returns the same range as Incl(num, num).
public static Only ( FPI16 num ) : MathFPI16>.NumRange
num FPI16
Результат MathFPI16>.NumRange

Only() публичный статический Метод

Returns the same range as Incl(num, num).
public static Only ( FPI8 num ) : MathFPI8>.NumRange
num FPI8
Результат MathFPI8>.NumRange

Only() публичный статический Метод

Returns the same range as Incl(num, num).
public static Only ( double num ) : MathD>.NumRange
num double
Результат MathD>.NumRange

Only() публичный статический Метод

Returns the same range as Incl(num, num).
public static Only ( float num ) : MathF>.NumRange
num float
Результат MathF>.NumRange

Only() публичный статический Метод

Returns the same range as Incl(num, num).
public static Only ( int num ) : MathI>.NumRange
num int
Результат MathI>.NumRange

Only() публичный статический Метод

Returns the same range as Incl(num, num).
public static Only ( long num ) : MathL>.NumRange
num long
Результат MathL>.NumRange

Only() публичный статический Метод

Returns the same range as Incl(num, num).
public static Only ( uint num ) : MathU>.NumRange
num uint
Результат MathU>.NumRange

Only() публичный статический Метод

Returns the same range as Incl(num, num).
public static Only ( ulong num ) : MathUL>.NumRange
num ulong
Результат MathUL>.NumRange

StartingAt() публичный статический Метод

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( FPI16 lo ) : MathFPI16>.NumRange
lo FPI16
Результат MathFPI16>.NumRange

StartingAt() публичный статический Метод

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( FPI8 lo ) : MathFPI8>.NumRange
lo FPI8
Результат MathFPI8>.NumRange

StartingAt() публичный статический Метод

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( double lo ) : MathD>.NumRange
lo double
Результат MathD>.NumRange

StartingAt() публичный статический Метод

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( float lo ) : MathF>.NumRange
lo float
Результат MathF>.NumRange

StartingAt() публичный статический Метод

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( int lo ) : MathI>.NumRange
lo int
Результат MathI>.NumRange

StartingAt() публичный статический Метод

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( long lo ) : MathL>.NumRange
lo long
Результат MathL>.NumRange

StartingAt() публичный статический Метод

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( uint lo ) : MathU>.NumRange
lo uint
Результат MathU>.NumRange

StartingAt() публичный статический Метод

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( ulong lo ) : MathUL>.NumRange
lo ulong
Результат MathUL>.NumRange

UntilExclusive() публичный статический Метод

public static UntilExclusive ( uint hi ) : MathU>.NumRange
hi uint
Результат MathU>.NumRange

UntilExclusive() публичный статический Метод

public static UntilExclusive ( ulong hi ) : MathUL>.NumRange
hi ulong
Результат MathUL>.NumRange

UntilInclusive() публичный статический Метод

public static UntilInclusive ( uint hi ) : MathU>.NumRange
hi uint
Результат MathU>.NumRange

UntilInclusive() публичный статический Метод

public static UntilInclusive ( ulong hi ) : MathUL>.NumRange
hi ulong
Результат MathUL>.NumRange