轻轻松松改成定点数咯

This commit is contained in:
DESKTOP-5RP3AKU\Jisol
2024-10-21 04:04:13 +08:00
parent 0371576f87
commit 930911e7df
46 changed files with 1070 additions and 317 deletions

View File

@@ -621,12 +621,17 @@ namespace JNGame.Math
/// 毫秒单位时间 = 0.001f
/// </summary>
public static readonly LFloat EPS_1MS = new LFloat(null, 1L);
/// <summary>
/// 0
/// </summary>
public static LFloat L0 => 0.ToLFloat();
/// <summary>
/// 10
/// </summary>
public static LFloat L05 => new("",500);
public static LFloat L0D5 => new("",500);
/// <summary>
/// 10
@@ -652,6 +657,11 @@ namespace JNGame.Math
/// 10000
/// </summary>
public static readonly LFloat L10000 = 10000.ToLFloat();
/// <summary>
/// 360
/// </summary>
public static readonly LFloat L360 = 360.ToLFloat();
#endregion
}

View File

@@ -577,6 +577,14 @@ namespace JNGame.Math
#region MinMaxClamp相关
public static bool Approximately(LFloat a, LFloat b)
{
// 计算两个浮点数之间的差的绝对值
float difference = Abs(a - b);
// 检查差的绝对值是否小于阈值
return difference < LFloat.EPSILON;
}
public static int Clamp(int value, int min, int max)
{
if (value < min)