feat: 添加下载进度条
This commit is contained in:
@@ -348,4 +348,37 @@ public class Number
|
||||
}
|
||||
return dstBytes;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取数字的长度
|
||||
/// </summary>
|
||||
/// <param name="number">数字</param>
|
||||
/// <returns>数字的长度</returns>
|
||||
public static int GetLength(int number)
|
||||
{
|
||||
// 将整数转换为字符串
|
||||
string numberString = number.ToString();
|
||||
|
||||
// 返回字符串的长度
|
||||
return numberString.Length;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 计算整形的幂
|
||||
/// </summary>
|
||||
/// <param name="x">底数</param>
|
||||
/// <param name="pow">幂</param>
|
||||
/// <returns>计算结果</returns>
|
||||
public static int IntPow(int x, int pow)
|
||||
{
|
||||
int ret = 1;
|
||||
while (pow != 0)
|
||||
{
|
||||
if ((pow & 1) == 1)
|
||||
ret *= x;
|
||||
x *= x;
|
||||
pow >>= 1;
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user