using System;

namespace KitsuneCafe.Extension
{
    public static class KMath
    {
        public static bool IsApproxEqual(this float value, float other)
        {
            return IsApproxEqual(value, other, 0.001f);
        }

        public static bool IsApproxEqual(this float value, float other, float epsilon)
        {
            return Math.Abs(value - other) < epsilon;
        }

        public static bool And(bool a, bool b)
        {
            return a && b;
        }

        public static bool Or(bool a, bool b)
        {
            return a || b;
        }

        public static bool Not(bool value)
        {
            return !value;
        }

        public static int Add(sbyte a, sbyte b)
        {
            return a + b;
        }

        public static int Add(byte a, byte b)
        {
            return a + b;
        }

        public static int Add(short a, short b)
        {
            return a + b;
        }

        public static int Add(ushort a, ushort b)
        {
            return a + b;
        }

        public static int Add(int a, int b)
        {
            return a + b;
        }

        public static uint Add(uint a, uint b)
        {
            return a + b;
        }

        public static long Add(long a, long b)
        {
            return a + b;
        }

        public static ulong Add(ulong a, ulong b)
        {
            return a + b;
        }

        public static nint Add(nint a, nint b)
        {
            return a + b;
        }

        public static nuint Add(nuint a, nuint b)
        {
            return a + b;
        }

        public static float Add(float a, float b)
        {
            return a + b;
        }

        public static double Add(double a, double b)
        {
            return a + b;
        }

        public static decimal Add(decimal a, decimal b)
        {
            return a + b;
        }

        public static int Sub(sbyte a, sbyte b)
        {
            return a - b;
        }

        public static int Sub(byte a, byte b)
        {
            return a - b;
        }

        public static int Sub(short a, short b)
        {
            return a - b;
        }

        public static int Sub(ushort a, ushort b)
        {
            return a - b;
        }

        public static int Sub(int a, int b)
        {
            return a - b;
        }

        public static uint Sub(uint a, uint b)
        {
            return a - b;
        }

        public static long Sub(long a, long b)
        {
            return a - b;
        }

        public static ulong Sub(ulong a, ulong b)
        {
            return a - b;
        }

        public static nint Sub(nint a, nint b)
        {
            return a - b;
        }

        public static nuint Sub(nuint a, nuint b)
        {
            return a - b;
        }

        public static float Sub(float a, float b)
        {
            return a - b;
        }

        public static double Sub(double a, double b)
        {
            return a - b;
        }

        public static decimal Sub(decimal a, decimal b)
        {
            return a - b;
        }

    }
}
