EvenOrOdd 1.1.0
dotnet add package EvenOrOdd --version 1.1.0
NuGet\Install-Package EvenOrOdd -Version 1.1.0
<PackageReference Include="EvenOrOdd" Version="1.1.0" />
paket add EvenOrOdd --version 1.1.0
#r "nuget: EvenOrOdd, 1.1.0"
// Install EvenOrOdd as a Cake Addin #addin nuget:?package=EvenOrOdd&version=1.1.0 // Install EvenOrOdd as a Cake Tool #tool nuget:?package=EvenOrOdd&version=1.1.0
README
This library defines a Nuget package that contains extension methods for various .NET integer types, to quickly determine if they contain values that are even or odd.
A quick reminder; even values are values that are divisible by 2, so -2, 0, 2, 4, 6, and so on, and odd values are all the other values, so -1, 1, 3, 5, 7, and so on.
Installation
To install the nuget package into your project, either use your favorite nuget package manager, or use the following command:
dotnet add package EvenOrOdd
Usage
All existing .NET integer data types are given two new extension methods:
public static bool IsEven(this TYPE value) { ... }
public static bool IsOdd(this TYPE value) { ... }
You would simply use them as any other extension method. Here is an example:
int numberOfSmellySocks = File.ReadAllLines("smellysocks.txt").Length;
if (numberOfSmellySocks.IsEven())
Console.WriteLine("Even smellyness detected, both your feet smell");
else
Console.WriteLine("Uneven smellyness detected, one of your feet is not smelling as much");
Product | Versions Compatible and additional computed target framework versions. |
---|---|
.NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. |
-
net8.0
- No dependencies.
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
Version | Downloads | Last updated |
---|---|---|
1.1.0 | 124 | 8/17/2024 |