mirror of
https://github.com/Stone-Red-Code/RemSox.git
synced 2026-09-04 00:56:19 +02:00
19 lines
355 B
C#
19 lines
355 B
C#
using System.Runtime;
|
|
|
|
namespace RemSox.Kernel.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);
|
|
}
|
|
}
|