EvenOrOdd 1.1.0

dotnet add package EvenOrOdd --version 1.1.0                
NuGet\Install-Package EvenOrOdd -Version 1.1.0                
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="EvenOrOdd" Version="1.1.0" />                
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EvenOrOdd --version 1.1.0                
#r "nuget: EvenOrOdd, 1.1.0"                
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// 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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • 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 132 8/17/2024