Ln(x) and Sqrtaï(x) function added
This commit is contained in:
@@ -1,54 +1,78 @@
|
||||
using StgSharp;
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
internal class Program
|
||||
{
|
||||
private static void Main(string[] args)
|
||||
private unsafe static void Main(string[] args)
|
||||
{
|
||||
Console.WriteLine("Hello, World!");
|
||||
a asd = new a();
|
||||
ase a01 = new ase(asd.cwc);
|
||||
ase a02 = a01;
|
||||
a01 -= asd.cwc;
|
||||
a01 += asd.cwb;
|
||||
a01.Invoke();
|
||||
a02.Invoke();
|
||||
|
||||
a fff = new a();
|
||||
fff._a = 10;
|
||||
a ggg = fff;
|
||||
fff._a = 15;
|
||||
Console.WriteLine(ggg._a);
|
||||
|
||||
Point p = new Point();
|
||||
Point p2 = new Point();
|
||||
ContainerNode<Point> pC = new ContainerNode<Point>(p);
|
||||
ContainerNode<Point> pC02 = new ContainerNode<Point>(p2);
|
||||
pC.Next=pC02;
|
||||
|
||||
/*
|
||||
int cc = 3;
|
||||
Console.WriteLine(cc/2);
|
||||
/**/
|
||||
|
||||
/*
|
||||
float aa = 261.2776027f;
|
||||
uint bb = *(uint*)&aa;
|
||||
Console.WriteLine(Convert.ToString(bb,toBase:2));
|
||||
Console.WriteLine(StgSharp.Math.Log(3.5f));
|
||||
/**/
|
||||
|
||||
|
||||
for (int wasd = 0; wasd < 100; wasd++)
|
||||
{
|
||||
float time = 1000000;
|
||||
double a = 114514;
|
||||
System.Diagnostics.Stopwatch stopwatch = new Stopwatch();
|
||||
stopwatch.Start(); // 开始监视代码运行时间
|
||||
for (float i = 2; i < time; i++)
|
||||
{
|
||||
a = StgSharp.Math.Log(i);
|
||||
}
|
||||
stopwatch.Stop(); // 停止监视
|
||||
TimeSpan timespan = stopwatch.Elapsed; // 获取当前实例测量得出的总时间
|
||||
double milliseconds = timespan.TotalMilliseconds; // 总毫秒数
|
||||
Console.WriteLine($"{milliseconds},{a}");
|
||||
|
||||
|
||||
System.Diagnostics.Stopwatch stopwatch1 = new Stopwatch();
|
||||
double b = 114514;
|
||||
double time2 = time;
|
||||
stopwatch1.Start();
|
||||
for (double i = 2; i < time2; i++)
|
||||
{
|
||||
b = System.Math.Log(i);
|
||||
}
|
||||
stopwatch1.Stop();
|
||||
timespan = stopwatch1.Elapsed;
|
||||
double milliseconds2 = timespan.TotalMilliseconds;
|
||||
Console.WriteLine($"{milliseconds2},{b}");
|
||||
Console.WriteLine("");
|
||||
}
|
||||
/**/
|
||||
|
||||
/*
|
||||
double accuracy = 0;
|
||||
for (float i = 1.001f; i < 4; i += 0.001f)
|
||||
{
|
||||
double r1 = StgSharp.Math.Log(i);
|
||||
double r2 = System.Math.Log(i);
|
||||
double ac = ( System.Math.Max(r1,r2)- System.Math.Min(r1, r2) ) / System.Math.Max(r1, r2);
|
||||
if (ac>accuracy)
|
||||
{
|
||||
accuracy = ac;
|
||||
Console.WriteLine(i);
|
||||
Console.WriteLine(ac);
|
||||
Console.WriteLine(r1);
|
||||
Console.WriteLine(r2);
|
||||
Console.WriteLine("");
|
||||
}
|
||||
}
|
||||
Console.WriteLine(accuracy);
|
||||
/**/
|
||||
}
|
||||
|
||||
public delegate void ase();
|
||||
|
||||
|
||||
}
|
||||
|
||||
class a
|
||||
{
|
||||
public int _a;
|
||||
|
||||
public void cwc()
|
||||
{
|
||||
Console.WriteLine("c");
|
||||
}
|
||||
public void cwb()
|
||||
{
|
||||
Console.WriteLine("b");
|
||||
}
|
||||
}
|
||||
@@ -5,6 +5,7 @@
|
||||
<TargetFramework>net6.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
<AllowUnsafeBlocks>True</AllowUnsafeBlocks>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -4,5 +4,14 @@
|
||||
<name>StgSharp</name>
|
||||
</assembly>
|
||||
<members>
|
||||
<member name="M:StgSharp.Math.Log(System.Single)">
|
||||
<summary>
|
||||
|
||||
</summary>
|
||||
<param name="x"></param>
|
||||
<returns>
|
||||
Returns the value of ln(x).
|
||||
</returns>
|
||||
</member>
|
||||
</members>
|
||||
</doc>
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user