C# Class 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).
Exibir arquivo Open project: qwertie/ecsharp

Public Methods

Method Description
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

Method Details

ExcludeHi() public static method

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
return MathFPI16>.NumRange

ExcludeHi() public static method

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
return MathFPI8>.NumRange

ExcludeHi() public static method

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
return MathD>.NumRange

ExcludeHi() public static method

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
return MathF>.NumRange

ExcludeHi() public static method

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
return MathI>.NumRange

ExcludeHi() public static method

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
return MathL>.NumRange

ExcludeHi() public static method

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
return MathU>.NumRange

ExcludeHi() public static method

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
return MathUL>.NumRange

Inclusive() public static method

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
return MathFPI16>.NumRange

Inclusive() public static method

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
return MathFPI8>.NumRange

Inclusive() public static method

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
return MathD>.NumRange

Inclusive() public static method

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
return MathF>.NumRange

Inclusive() public static method

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
return MathI>.NumRange

Inclusive() public static method

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
return MathL>.NumRange

Inclusive() public static method

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
return MathU>.NumRange

Inclusive() public static method

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
return MathUL>.NumRange

Only() public static method

Returns the same range as Incl(num, num).
public static Only ( FPI16 num ) : MathFPI16>.NumRange
num FPI16
return MathFPI16>.NumRange

Only() public static method

Returns the same range as Incl(num, num).
public static Only ( FPI8 num ) : MathFPI8>.NumRange
num FPI8
return MathFPI8>.NumRange

Only() public static method

Returns the same range as Incl(num, num).
public static Only ( double num ) : MathD>.NumRange
num double
return MathD>.NumRange

Only() public static method

Returns the same range as Incl(num, num).
public static Only ( float num ) : MathF>.NumRange
num float
return MathF>.NumRange

Only() public static method

Returns the same range as Incl(num, num).
public static Only ( int num ) : MathI>.NumRange
num int
return MathI>.NumRange

Only() public static method

Returns the same range as Incl(num, num).
public static Only ( long num ) : MathL>.NumRange
num long
return MathL>.NumRange

Only() public static method

Returns the same range as Incl(num, num).
public static Only ( uint num ) : MathU>.NumRange
num uint
return MathU>.NumRange

Only() public static method

Returns the same range as Incl(num, num).
public static Only ( ulong num ) : MathUL>.NumRange
num ulong
return MathUL>.NumRange

StartingAt() public static method

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( FPI16 lo ) : MathFPI16>.NumRange
lo FPI16
return MathFPI16>.NumRange

StartingAt() public static method

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( FPI8 lo ) : MathFPI8>.NumRange
lo FPI8
return MathFPI8>.NumRange

StartingAt() public static method

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( double lo ) : MathD>.NumRange
lo double
return MathD>.NumRange

StartingAt() public static method

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( float lo ) : MathF>.NumRange
lo float
return MathF>.NumRange

StartingAt() public static method

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( int lo ) : MathI>.NumRange
lo int
return MathI>.NumRange

StartingAt() public static method

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( long lo ) : MathL>.NumRange
lo long
return MathL>.NumRange

StartingAt() public static method

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( uint lo ) : MathU>.NumRange
lo uint
return MathU>.NumRange

StartingAt() public static method

Returns a range from lo to the MaxValue of the number type.
public static StartingAt ( ulong lo ) : MathUL>.NumRange
lo ulong
return MathUL>.NumRange

UntilExclusive() public static method

public static UntilExclusive ( uint hi ) : MathU>.NumRange
hi uint
return MathU>.NumRange

UntilExclusive() public static method

public static UntilExclusive ( ulong hi ) : MathUL>.NumRange
hi ulong
return MathUL>.NumRange

UntilInclusive() public static method

public static UntilInclusive ( uint hi ) : MathU>.NumRange
hi uint
return MathU>.NumRange

UntilInclusive() public static method

public static UntilInclusive ( ulong hi ) : MathUL>.NumRange
hi ulong
return MathUL>.NumRange