mirror of
https://github.com/oliverbooth/X10D
synced 2024-11-22 13:48:47 +00:00
refactor: rename TNumber as TInteger
This commit is contained in:
parent
b8f85e4270
commit
2da8c7db7a
@ -1,4 +1,4 @@
|
|||||||
#if NET7_0_OR_GREATER
|
#if NET7_0_OR_GREATER
|
||||||
using System.Diagnostics.Contracts;
|
using System.Diagnostics.Contracts;
|
||||||
using System.Numerics;
|
using System.Numerics;
|
||||||
using System.Runtime.CompilerServices;
|
using System.Runtime.CompilerServices;
|
||||||
@ -18,10 +18,10 @@ public static class BinaryIntegerExtensions
|
|||||||
/// <returns>The number of digits in <paramref name="value" />.</returns>
|
/// <returns>The number of digits in <paramref name="value" />.</returns>
|
||||||
[Pure]
|
[Pure]
|
||||||
[MethodImpl(CompilerResources.MethodImplOptions)]
|
[MethodImpl(CompilerResources.MethodImplOptions)]
|
||||||
public static int CountDigits<TNumber>(this TNumber value)
|
public static int CountDigits<TInteger>(this TInteger value)
|
||||||
where TNumber : IBinaryInteger<TNumber>
|
where TInteger : IBinaryInteger<TInteger>
|
||||||
{
|
{
|
||||||
if (TNumber.IsZero(value))
|
if (TInteger.IsZero(value))
|
||||||
{
|
{
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user