initial commit
This commit is contained in:
@@ -0,0 +1,56 @@
|
||||
using System.Runtime.CompilerServices;
|
||||
|
||||
namespace System;
|
||||
|
||||
internal static class MathF
|
||||
{
|
||||
public const float PI = 3.1415927f;
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Abs(float x)
|
||||
{
|
||||
return Math.Abs(x);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Acos(float x)
|
||||
{
|
||||
return (float)Math.Acos(x);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Cos(float x)
|
||||
{
|
||||
return (float)Math.Cos(x);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float IEEERemainder(float x, float y)
|
||||
{
|
||||
return (float)Math.IEEERemainder(x, y);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Pow(float x, float y)
|
||||
{
|
||||
return (float)Math.Pow(x, y);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Sin(float x)
|
||||
{
|
||||
return (float)Math.Sin(x);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Sqrt(float x)
|
||||
{
|
||||
return (float)Math.Sqrt(x);
|
||||
}
|
||||
|
||||
[MethodImpl(MethodImplOptions.AggressiveInlining)]
|
||||
public static float Tan(float x)
|
||||
{
|
||||
return (float)Math.Tan(x);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
using System.Resources;
|
||||
using System.Runtime.CompilerServices;
|
||||
using FxResources.System.Numerics.Vectors;
|
||||
|
||||
namespace System;
|
||||
|
||||
internal static class SR
|
||||
{
|
||||
private static ResourceManager s_resourceManager;
|
||||
|
||||
private static ResourceManager ResourceManager => s_resourceManager ?? (s_resourceManager = new ResourceManager(ResourceType));
|
||||
|
||||
internal static Type ResourceType { get; } = typeof(SR);
|
||||
|
||||
internal static string Arg_ArgumentOutOfRangeException => GetResourceString("Arg_ArgumentOutOfRangeException", null);
|
||||
|
||||
internal static string Arg_ElementsInSourceIsGreaterThanDestination => GetResourceString("Arg_ElementsInSourceIsGreaterThanDestination", null);
|
||||
|
||||
internal static string Arg_NullArgumentNullRef => GetResourceString("Arg_NullArgumentNullRef", null);
|
||||
|
||||
internal static string Arg_TypeNotSupported => GetResourceString("Arg_TypeNotSupported", null);
|
||||
|
||||
internal static string Arg_InsufficientNumberOfElements => GetResourceString("Arg_InsufficientNumberOfElements", null);
|
||||
|
||||
[MethodImpl(MethodImplOptions.NoInlining)]
|
||||
private static bool UsingResourceKeys()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
internal static string GetResourceString(string resourceKey, string defaultString)
|
||||
{
|
||||
string text = null;
|
||||
try
|
||||
{
|
||||
text = ResourceManager.GetString(resourceKey);
|
||||
}
|
||||
catch (MissingManifestResourceException)
|
||||
{
|
||||
}
|
||||
if (defaultString != null && resourceKey.Equals(text, StringComparison.Ordinal))
|
||||
{
|
||||
return defaultString;
|
||||
}
|
||||
return text;
|
||||
}
|
||||
|
||||
internal static string Format(string resourceFormat, params object[] args)
|
||||
{
|
||||
if (args != null)
|
||||
{
|
||||
if (UsingResourceKeys())
|
||||
{
|
||||
return resourceFormat + string.Join(", ", args);
|
||||
}
|
||||
return string.Format(resourceFormat, args);
|
||||
}
|
||||
return resourceFormat;
|
||||
}
|
||||
|
||||
internal static string Format(string resourceFormat, object p1)
|
||||
{
|
||||
if (UsingResourceKeys())
|
||||
{
|
||||
return string.Join(", ", new object[2] { resourceFormat, p1 });
|
||||
}
|
||||
return string.Format(resourceFormat, p1);
|
||||
}
|
||||
|
||||
internal static string Format(string resourceFormat, object p1, object p2)
|
||||
{
|
||||
if (UsingResourceKeys())
|
||||
{
|
||||
return string.Join(", ", new object[3] { resourceFormat, p1, p2 });
|
||||
}
|
||||
return string.Format(resourceFormat, p1, p2);
|
||||
}
|
||||
|
||||
internal static string Format(string resourceFormat, object p1, object p2, object p3)
|
||||
{
|
||||
if (UsingResourceKeys())
|
||||
{
|
||||
return string.Join(", ", new object[4] { resourceFormat, p1, p2, p3 });
|
||||
}
|
||||
return string.Format(resourceFormat, p1, p2, p3);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user