Daily update on 20230204 by nitload youmu, pow func added
This commit is contained in:
@@ -12,12 +12,13 @@ internal class Program
|
||||
/**/
|
||||
|
||||
/*
|
||||
float test = StgSharp.Math.ASin(StgSharp.Math.Sqrt(3.0f) / 2);
|
||||
float test = StgSharp.Math.Pow(4.0f,0.125f);
|
||||
Console.WriteLine(test);
|
||||
/**/
|
||||
|
||||
/*
|
||||
for (int wasd = 0; wasd < 100; wasd++)
|
||||
// 测速
|
||||
for (int cycle = 0; cycle < 100; cycle++)
|
||||
{
|
||||
float time = 1000000;
|
||||
float a = 114514;
|
||||
@@ -25,7 +26,7 @@ internal class Program
|
||||
stopwatch.Start(); // 开始监视代码运行时间
|
||||
for (float i = 2; i < time; i++)
|
||||
{
|
||||
a = StgSharp.Math.ASin(i/(time/2)-1);
|
||||
a = StgSharp.Math.Pow(i, i);
|
||||
}
|
||||
stopwatch.Stop(); // 停止监视
|
||||
TimeSpan timespan = stopwatch.Elapsed; // 获取当前实例测量得出的总时间
|
||||
@@ -39,7 +40,7 @@ internal class Program
|
||||
stopwatch1.Start();
|
||||
for (float i = 2; i < time2; i++)
|
||||
{
|
||||
b = System.MathF.Asin(i / (time / 2) - 1);
|
||||
b = System.MathF.Pow(i, i);
|
||||
}
|
||||
stopwatch1.Stop();
|
||||
timespan = stopwatch1.Elapsed;
|
||||
@@ -49,13 +50,15 @@ internal class Program
|
||||
}
|
||||
/**/
|
||||
|
||||
/*
|
||||
|
||||
|
||||
//精度测试
|
||||
double accuracy = 0;
|
||||
for (float i = -1f; i < 1f; i += 0.000001f)
|
||||
for (float i = -10f; i < 2000f; i += 0.01f)
|
||||
{
|
||||
|
||||
double r1 = StgSharp.Math.ASin(i);
|
||||
double r2 = System.Math.Asin(i)*180/3.1415926;
|
||||
double r1 = StgSharp.Math.Pow(2,i);
|
||||
double r2 = System.Math.Pow(2,i);
|
||||
double ac = ( System.Math.Max(r1,r2)- System.Math.Min(r1, r2) ) / r2;
|
||||
if (ac>accuracy)
|
||||
{
|
||||
@@ -72,8 +75,5 @@ internal class Program
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user