daily update on 20230813 by nitload youmu, weritting matrix algs
This commit is contained in:
@@ -24,7 +24,7 @@ namespace StgSharp.Math
|
||||
{
|
||||
float seed = currentSeed;
|
||||
|
||||
float sample = Calc.Pow(Calc.Sqrt(seed),2);
|
||||
float sample = Calc.Pow(Calc.SeedSqrt(seed),2);
|
||||
float sample2 = (sample - seed) / seed;
|
||||
sample2 = Calc.Abs(sample2);
|
||||
|
||||
|
||||
@@ -1,11 +1,27 @@
|
||||
using System;
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace StgSharp.Math
|
||||
{
|
||||
public static partial class Calc
|
||||
{
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Sqrt(float x)
|
||||
{
|
||||
|
||||
public static unsafe float Sqrt(float x)
|
||||
/**/
|
||||
#if NET6_0_OR_GREATER
|
||||
return System.MathF.Sqrt(x);
|
||||
#else
|
||||
|
||||
/**/
|
||||
return internalIO.sqrtss_const_internal(x);
|
||||
/**/
|
||||
#endif
|
||||
/**/
|
||||
}
|
||||
|
||||
public static unsafe float SeedSqrt(float x)
|
||||
{
|
||||
/*
|
||||
* 本方法采用分别对指数和小数处理的方法计算平方根
|
||||
|
||||
Reference in New Issue
Block a user