Class UInt32Extensions
Extension methods for
Inheritance
Namespace: X10D.Math
Assembly: X10D.dll
Syntax
public static class UInt32Extensions : object
Methods
| Improve this Doc View SourceCountDigits(UInt32)
Returns the number of digits in the current 32-bit unsigned integer.
Declaration
public static int CountDigits(this uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value whose digit count to compute. |
Returns
Type | Description |
---|---|
System.Int32 | The number of digits in |
DigitalRoot(UInt32)
Computes the digital root of the current 32-bit unsigned integer.
Declaration
public static uint DigitalRoot(this uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value whose digital root to compute. |
Returns
Type | Description |
---|---|
System.UInt32 | The digital root of |
Remarks
The digital root is defined as the recursive sum of digits until that result is a single digit.
For example, the digital root of 239 is 5: 2 + 3 + 9 = 14
, then 1 + 4 = 5
.
Factorial(UInt32)
Returns the factorial of the current 32-bit unsigned integer.
Declaration
public static ulong Factorial(this uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value whose factorial to compute. |
Returns
Type | Description |
---|---|
System.UInt64 | The factorial of |
GreatestCommonFactor(UInt32, UInt32)
Calculates the greatest common factor between the current 32-bit unsigned integer, and another 32-bit unsigned integer.
Declaration
public static uint GreatestCommonFactor(this uint value, uint other)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The first value. |
System.UInt32 | other | The second value. |
Returns
Type | Description |
---|---|
System.UInt32 | The greatest common factor between |
IsEven(UInt32)
Returns a value indicating whether the current value is evenly divisible by 2.
Declaration
public static bool IsEven(this uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value whose parity to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
IsOdd(UInt32)
Returns a value indicating whether the current value is not evenly divisible by 2.
Declaration
public static bool IsOdd(this uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value whose parity to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
IsPrime(UInt32)
Returns a value indicating whether the current value is a prime number.
Declaration
public static bool IsPrime(this uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value whose primality to check. |
Returns
Type | Description |
---|---|
System.Boolean | true if |
LowestCommonMultiple(UInt32, UInt32)
Calculates the lowest common multiple between the current 32-bit unsigned integer, and another 32-bit unsigned integer.
Declaration
public static uint LowestCommonMultiple(this uint value, uint other)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The first value. |
System.UInt32 | other | The second value. |
Returns
Type | Description |
---|---|
System.UInt32 | The lowest common multiple between |
MultiplicativePersistence(UInt32)
Returns the multiplicative persistence of a specified value.
Declaration
public static int MultiplicativePersistence(this uint value)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value whose multiplicative persistence to calculate. |
Returns
Type | Description |
---|---|
System.Int32 | The multiplicative persistence. |
Remarks
Multiplicative persistence is defined as the recursive digital product until that product is a single digit.
Wrap(UInt32, UInt32)
Wraps the current 32-bit unsigned integer between 0 and a high value.
Declaration
public static uint Wrap(this uint value, uint length)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value to wrap. |
System.UInt32 | length | The exclusive upper bound. |
Returns
Type | Description |
---|---|
System.UInt32 | The wrapped value. |
Wrap(UInt32, UInt32, UInt32)
Wraps the current 32-bit unsigned integer between a low and a high value.
Declaration
public static uint Wrap(this uint value, uint low, uint high)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | value | The value to wrap. |
System.UInt32 | low | The inclusive lower bound. |
System.UInt32 | high | The exclusive upper bound. |
Returns
Type | Description |
---|---|
System.UInt32 | The wrapped value. |