Class ArithmeticExtensions
- Namespace
- LfrlAnvil.Extensions
- Assembly
- LfrlAnvil.Core.dll
Contains arithmetic extension methods.
public static class ArithmeticExtensions
- Inheritance
-
ArithmeticExtensions
- Inherited Members
Methods
EuclidModulo(byte, byte)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static byte EuclidModulo(this byte a, byte b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
EuclidModulo(decimal, decimal)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static decimal EuclidModulo(this decimal a, decimal b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
EuclidModulo(double, double)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static double EuclidModulo(this double a, double b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
EuclidModulo(short, short)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static short EuclidModulo(this short a, short b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
EuclidModulo(int, int)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static int EuclidModulo(this int a, int b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
EuclidModulo(long, long)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static long EuclidModulo(this long a, long b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
EuclidModulo(sbyte, sbyte)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static sbyte EuclidModulo(this sbyte a, sbyte b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
EuclidModulo(float, float)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static float EuclidModulo(this float a, float b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
EuclidModulo(ushort, ushort)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static ushort EuclidModulo(this ushort a, ushort b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
EuclidModulo(uint, uint)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static uint EuclidModulo(this uint a, uint b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
EuclidModulo(ulong, ulong)
Calculates the remainder of a euclidean division of a
by b
.
[Pure]
public static ulong EuclidModulo(this ulong a, ulong b)
Parameters
Returns
Exceptions
- DivideByZeroException
When
b
is equal to 0.
IsEven(byte)
Checks if the provided byte value is even.
[Pure]
public static bool IsEven(this byte x)
Parameters
x
byteValue to check.
Returns
- bool
true when
x
is even, otherwise false.
IsEven(short)
Checks if the provided short value is even.
[Pure]
public static bool IsEven(this short x)
Parameters
x
shortValue to check.
Returns
- bool
true when
x
is even, otherwise false.
IsEven(int)
Checks if the provided int value is even.
[Pure]
public static bool IsEven(this int x)
Parameters
x
intValue to check.
Returns
- bool
true when
x
is even, otherwise false.
IsEven(long)
Checks if the provided long value is even.
[Pure]
public static bool IsEven(this long x)
Parameters
x
longValue to check.
Returns
- bool
true when
x
is even, otherwise false.
IsEven(sbyte)
Checks if the provided sbyte value is even.
[Pure]
public static bool IsEven(this sbyte x)
Parameters
x
sbyteValue to check.
Returns
- bool
true when
x
is even, otherwise false.
IsEven(ushort)
Checks if the provided ushort value is even.
[Pure]
public static bool IsEven(this ushort x)
Parameters
x
ushortValue to check.
Returns
- bool
true when
x
is even, otherwise false.
IsEven(uint)
Checks if the provided uint value is even.
[Pure]
public static bool IsEven(this uint x)
Parameters
x
uintValue to check.
Returns
- bool
true when
x
is even, otherwise false.
IsEven(ulong)
Checks if the provided ulong value is even.
[Pure]
public static bool IsEven(this ulong x)
Parameters
x
ulongValue to check.
Returns
- bool
true when
x
is even, otherwise false.
IsOdd(byte)
Checks if the provided byte value is odd.
[Pure]
public static bool IsOdd(this byte x)
Parameters
x
byteValue to check.
Returns
- bool
true when
x
is odd, otherwise false.
IsOdd(short)
Checks if the provided short value is odd.
[Pure]
public static bool IsOdd(this short x)
Parameters
x
shortValue to check.
Returns
- bool
true when
x
is odd, otherwise false.
IsOdd(int)
Checks if the provided int value is odd.
[Pure]
public static bool IsOdd(this int x)
Parameters
x
intValue to check.
Returns
- bool
true when
x
is odd, otherwise false.
IsOdd(long)
Checks if the provided long value is odd.
[Pure]
public static bool IsOdd(this long x)
Parameters
x
longValue to check.
Returns
- bool
true when
x
is odd, otherwise false.
IsOdd(sbyte)
Checks if the provided sbyte value is odd.
[Pure]
public static bool IsOdd(this sbyte x)
Parameters
x
sbyteValue to check.
Returns
- bool
true when
x
is odd, otherwise false.
IsOdd(ushort)
Checks if the provided ushort value is odd.
[Pure]
public static bool IsOdd(this ushort x)
Parameters
x
ushortValue to check.
Returns
- bool
true when
x
is odd, otherwise false.
IsOdd(uint)
Checks if the provided uint value is odd.
[Pure]
public static bool IsOdd(this uint x)
Parameters
x
uintValue to check.
Returns
- bool
true when
x
is odd, otherwise false.
IsOdd(ulong)
Checks if the provided ulong value is odd.
[Pure]
public static bool IsOdd(this ulong x)
Parameters
x
ulongValue to check.
Returns
- bool
true when
x
is odd, otherwise false.