mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-07 23:41:47 +02:00
Move fmod runtime export to Plugs/RuntimeExports.cs
This commit is contained in:
@@ -6,8 +6,6 @@ using RemSox.Processing;
|
|||||||
using RemSox.UI.CLI;
|
using RemSox.UI.CLI;
|
||||||
using RemSox.UI.CLI.Commands;
|
using RemSox.UI.CLI.Commands;
|
||||||
|
|
||||||
using System.Runtime;
|
|
||||||
|
|
||||||
namespace RemSox;
|
namespace RemSox;
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
@@ -65,17 +63,3 @@ public class Kernel : Sys.Kernel
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static unsafe partial class StartupCodeHelpers
|
|
||||||
{
|
|
||||||
[RuntimeExport("fmod")]
|
|
||||||
public static double fmod(double x, double y)
|
|
||||||
{
|
|
||||||
if (Math.Abs(y) < double.Epsilon)
|
|
||||||
{
|
|
||||||
return double.NaN;
|
|
||||||
}
|
|
||||||
|
|
||||||
double q = Math.Truncate(x / y);
|
|
||||||
return x - (q * y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
using System.Runtime;
|
||||||
|
|
||||||
|
namespace RemSox.Plugs;
|
||||||
|
|
||||||
|
public static partial class RuntimeExports
|
||||||
|
{
|
||||||
|
[RuntimeExport("fmod")]
|
||||||
|
public static double fmod(double x, double y)
|
||||||
|
{
|
||||||
|
if (Math.Abs(y) < double.Epsilon)
|
||||||
|
{
|
||||||
|
return double.NaN;
|
||||||
|
}
|
||||||
|
|
||||||
|
double q = Math.Truncate(x / y);
|
||||||
|
return x - (q * y);
|
||||||
|
}
|
||||||
|
}
|
||||||
Reference in New Issue
Block a user