2019-08-23 11:56:54 -07:00
|
|
|
namespace System
|
|
|
|
{
|
2020-08-10 13:27:48 -07:00
|
|
|
#unwarn
|
2020-06-05 15:46:31 +02:00
|
|
|
struct Int8 : int8, IInteger, ISigned, IHashable, IFormattable, IOpComparable, IIsNaN, IOpNegatable, IOpAddable, IOpSubtractable, IOpMultiplicable, IOpDividable
|
2019-08-23 11:56:54 -07:00
|
|
|
{
|
|
|
|
public const int32 MaxValue = 0x7F;
|
|
|
|
public const int32 MinValue = -0x80;
|
|
|
|
|
|
|
|
public static int operator<=>(Self a, Self b)
|
|
|
|
{
|
|
|
|
return (SelfBase)a <=> (SelfBase)b;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Self operator+(Self lhs, Self rhs)
|
|
|
|
{
|
|
|
|
return (SelfBase)lhs + (SelfBase)rhs;
|
|
|
|
}
|
|
|
|
|
2020-03-20 22:01:18 +00:00
|
|
|
public static Self operator-(Self lhs, Self rhs)
|
|
|
|
{
|
|
|
|
return (SelfBase)lhs - (SelfBase)rhs;
|
|
|
|
}
|
|
|
|
|
2019-08-23 11:56:54 -07:00
|
|
|
public static Self operator-(Self value)
|
|
|
|
{
|
|
|
|
return (SelfBase)value;
|
|
|
|
}
|
|
|
|
|
2020-06-05 15:46:31 +02:00
|
|
|
public static Self operator*(Self lhs, Self rhs)
|
|
|
|
{
|
|
|
|
return (SelfBase)lhs * (SelfBase)rhs;
|
|
|
|
}
|
|
|
|
|
|
|
|
public static Self operator/(Self lhs, Self rhs)
|
|
|
|
{
|
|
|
|
return (SelfBase)lhs / (SelfBase)rhs;
|
|
|
|
}
|
|
|
|
|
2020-02-18 08:41:14 -08:00
|
|
|
public int GetHashCode()
|
2019-08-23 11:56:54 -07:00
|
|
|
{
|
|
|
|
return (int)this;
|
|
|
|
}
|
|
|
|
|
|
|
|
bool IIsNaN.IsNaN
|
|
|
|
{
|
|
|
|
[SkipCall]
|
|
|
|
get
|
|
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2020-07-19 05:45:35 -07:00
|
|
|
public override void ToString(String outString)
|
|
|
|
{
|
|
|
|
((int32)this).ToString(outString);
|
|
|
|
}
|
|
|
|
|
2019-08-23 11:56:54 -07:00
|
|
|
public void ToString(String outString, String format, IFormatProvider formatProvider)
|
|
|
|
{
|
2020-05-31 11:55:36 -07:00
|
|
|
if(format == null || format.IsEmpty)
|
2019-08-23 11:56:54 -07:00
|
|
|
{
|
2020-05-31 11:55:36 -07:00
|
|
|
ToString(outString);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
NumberFormatter.NumberToString(format, (int32)this, formatProvider, outString);
|
2019-08-23 11:56:54 -07:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|