mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-28 04:28: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 UInt16 : uint16, IInteger, IUnsigned, IHashable, IFormattable, IIsNaN, IParseable<uint16, ParseError>, IParseable<uint16>
|
||||
struct UInt16 : uint16, IInteger, IUnsigned, IHashable, IFormattable, IIsNaN, IParseable<uint16, ParseError>, IParseable<uint16>, IMinMaxValue<uint16>
|
||||
{
|
||||
public enum ParseError
|
||||
{
|
||||
|
@ -16,6 +16,9 @@ namespace System
|
|||
public const uint16 MaxValue = 0xFFFF;
|
||||
public const uint16 MinValue = 0;
|
||||
|
||||
public static uint16 IMinMaxValue<uint16>.MinValue => MinValue;
|
||||
public static uint16 IMinMaxValue<uint16>.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