Created
October 6, 2022 08:32
-
-
Save SparkySimp/a40df2f22c8016833afdccfc58817d44 to your computer and use it in GitHub Desktop.
IntegerExtension.cs for NTP_100622_01
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class IntegerExtensions | |
{ | |
/// <summary> | |
/// Determines wheter an integer is odd or not. | |
/// </summary> | |
/// <param name="n">The number to test</param> | |
/// <returns>Wheter n is odd or not</returns> | |
public static bool IsOdd(this int n) => n % 2 != 0; | |
/// <summary> | |
/// Determines wheter an integer is even or not. | |
/// </summary> | |
/// <param name="n">The number to test</param> | |
/// <returns>Wheter n is even or not</returns> | |
public static bool IsEven(this int n) => n % 2 == 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment