Extension methods for int.
Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
See Also: Inherited members from object.
⊟ Public Methods
staticDownTo (this int, int) : IEnumerable<int> Creates an IEnumerable<int> which will return the values from self down to limit, inclusive. staticIsEven (this int) : bool Gets a value indicating whether value is an even number. staticIsOdd (this int) : bool Gets a value indicating whether value is an odd number. staticStep (this int, int, int) : IEnumerable<int> Creates an IEnumerable<int> which will return the values from self up to limit, inclusive, incrementing by step between each value. staticTimes (this int) : IEnumerable<int> Creates an IEnumerable<int> which will return the values between 0 and self, exclusive. staticUpTo (this int, int) : IEnumerable<int> Creates an IEnumerable<int> which will return the values from self up to limit, inclusive.
⊟ DownTo Method
Creates an IEnumerable<int> which will return the values from self down to limit, inclusive.
⊟ See Also
⊟ Parameters
⊟ Returns
An IEnumerable<int> with values between self down to limit, inclusive.⊟ Remarks
This method is implemented by using deferred execution.
Note: No bounds checking is performed, so if limit is greater than self, then (int.MaxValue - self - limit) values will be returned.⊟ Example
The following example demonstrates use of Int32Coda.DownTo(int, int):
C# Example Console.WriteLine (5.DownTo (0).Implode (", ")); // Prints "5, 4, 3, 2, 1, 0"⊟ Requirements
Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ IsEven Method
Gets a value indicating whether value is an even number.
⊟ See Also
⊟ Parameters
- value
- A int containing the value to check.
⊟ Returns
true if value is an even number; otherwise, false.⊟ Remarks
For purposes of this method, an even value is a number evenly divisible by 2 and the number 0; all other numbers are odd.⊟ Requirements
Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ IsOdd Method
Gets a value indicating whether value is an odd number.
⊟ See Also
⊟ Parameters
- value
- A int containing the value to check.
⊟ Returns
true if value is an odd number; otherwise, false.⊟ Remarks
For purposes of this method, an even value is a number evenly divisible by 2 and the number 0; all other numbers are odd.⊟ Requirements
Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Step Method
Creates an IEnumerable<int> which will return the values from self up to limit, inclusive, incrementing by step between each value.
⊟ See Also
⊟ Parameters
⊟ Returns
An IEnumerable<int> with values between self up to limit, inclusive.⊟ Remarks
This method is implemented by using deferred execution.
Note: No bounds checking is performed, so if limit is less than self, then ((int.MaxValue - self - limit) / step) values will be returned.⊟ Example
The following example demonstrates use of Int32Coda.Step(int, int, int):
C# Example Console.WriteLine (1.Step(9, 2).Implode (", ")); // Prints "1, 3, 5, 7, 9"⊟ Requirements
Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ Times Method
Creates an IEnumerable<int> which will return the values between 0 and self, exclusive.
public static IEnumerable<int> Times (this int self)⊟ See Also
⊟ Parameters
- self
- An int containing the positive upper limit.
⊟ Returns
An IEnumerable<int> with values between 0 up to self exclusive.⊟ Exceptions
Type Reason ArgumentOutOfRangeException self is less than 0. ⊟ Remarks
This method is implemented by using deferred execution.⊟ Example
The following example demonstrates use of Int32Coda.Times(int):
C# Example Console.WriteLine (6.Times ().Implode (", ")); // Prints "0, 1, 2, 3, 4, 5"⊟ Requirements
Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0
⊟ UpTo Method
Creates an IEnumerable<int> which will return the values from self up to limit, inclusive.
⊟ See Also
⊟ Parameters
⊟ Returns
An IEnumerable<int> with values between self up to limit, inclusive.⊟ Remarks
This method is implemented by using deferred execution.
Note: No bounds checking is performed, so if limit is less than than self, then (int.MaxValue - self - limit) values will be returned.⊟ Example
The following example demonstrates use of Int32Coda.UpTo(int, int):
C# Example Console.WriteLine (6.UpTo (12).Implode (", ")); // Prints "6, 7, 8, 9, 10, 11, 12"⊟ Requirements
Namespace: Cadenza
Assembly: Cadenza (in Cadenza.dll)
Assembly Versions: 0.1.0.0