mirror of
https://github.com/GreemDev/Ryujinx.git
synced 2025-08-30 07:25:05 +00:00
Some checks failed
Canary release job / Create tag (push) Has been cancelled
Canary release job / Release for linux-arm64 (push) Has been cancelled
Canary release job / Release for linux-x64 (push) Has been cancelled
Canary release job / Release for win-x64 (push) Has been cancelled
Canary release job / Release MacOS universal (push) Has been cancelled
71 lines
1.6 KiB
C#
71 lines
1.6 KiB
C#
using System;
|
|
using System.Runtime.InteropServices;
|
|
|
|
namespace ARMeilleure.Instructions
|
|
{
|
|
static class MathHelper
|
|
{
|
|
[UnmanagedCallersOnly]
|
|
public static double Abs(double value)
|
|
{
|
|
return Math.Abs(value);
|
|
}
|
|
|
|
[UnmanagedCallersOnly]
|
|
public static double Ceiling(double value)
|
|
{
|
|
return Math.Ceiling(value);
|
|
}
|
|
|
|
[UnmanagedCallersOnly]
|
|
public static double Floor(double value)
|
|
{
|
|
return Math.Floor(value);
|
|
}
|
|
|
|
[UnmanagedCallersOnly]
|
|
public static double Round(double value, int mode)
|
|
{
|
|
return Math.Round(value, (MidpointRounding)mode);
|
|
}
|
|
|
|
[UnmanagedCallersOnly]
|
|
public static double Truncate(double value)
|
|
{
|
|
return Math.Truncate(value);
|
|
}
|
|
}
|
|
|
|
static class MathHelperF
|
|
{
|
|
[UnmanagedCallersOnly]
|
|
public static float Abs(float value)
|
|
{
|
|
return MathF.Abs(value);
|
|
}
|
|
|
|
[UnmanagedCallersOnly]
|
|
public static float Ceiling(float value)
|
|
{
|
|
return MathF.Ceiling(value);
|
|
}
|
|
|
|
[UnmanagedCallersOnly]
|
|
public static float Floor(float value)
|
|
{
|
|
return MathF.Floor(value);
|
|
}
|
|
|
|
[UnmanagedCallersOnly]
|
|
public static float Round(float value, int mode)
|
|
{
|
|
return MathF.Round(value, (MidpointRounding)mode);
|
|
}
|
|
|
|
[UnmanagedCallersOnly]
|
|
public static float Truncate(float value)
|
|
{
|
|
return MathF.Truncate(value);
|
|
}
|
|
}
|
|
}
|