mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-26 19:48:01 +02:00
Add ability to get min/max values for generic int's and uint's
This commit is contained in:
parent
6302416e40
commit
484b9716db
12 changed files with 72 additions and 10 deletions
|
@ -3,7 +3,7 @@ using System.Globalization;
|
|||
namespace System
|
||||
{
|
||||
#unwarn
|
||||
struct Int8 : int8, IInteger, ISigned, IHashable, IFormattable, IIsNaN, IParseable<int8, ParseError>, IParseable<int8>
|
||||
struct Int8 : int8, IInteger, ISigned, IHashable, IFormattable, IIsNaN, IParseable<int8, ParseError>, IParseable<int8>, IMinMaxValue<int8>
|
||||
{
|
||||
public enum ParseError
|
||||
{
|
||||
|
@ -16,6 +16,9 @@ namespace System
|
|||
public const int8 MaxValue = 0x7F;
|
||||
public const int8 MinValue = -0x80;
|
||||
|
||||
public static int8 IMinMaxValue<int8>.MinValue => MinValue;
|
||||
public static int8 IMinMaxValue<int8>.MaxValue => MaxValue;
|
||||
|
||||
public static int operator<=>(Self a, Self b)
|
||||
{
|
||||
return (SelfBase)a <=> (SelfBase)b;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue