mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-27 03:58: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;
|
|||
namespace System
|
||||
{
|
||||
#unwarn
|
||||
struct Int : int, IInteger, IHashable, IFormattable, IIsNaN, IParseable<int, ParseError>, IParseable<int>
|
||||
struct Int : int, IInteger, IHashable, IFormattable, IIsNaN, IParseable<int, ParseError>, IParseable<int>, IMinMaxValue<int>
|
||||
{
|
||||
public enum ParseError
|
||||
{
|
||||
|
@ -16,6 +16,9 @@ namespace System
|
|||
public const int MaxValue = (sizeof(int) == 8) ? 0x7FFFFFFFFFFFFFFFL : 0x7FFFFFFF;
|
||||
public const int MinValue = (sizeof(int) == 8) ? -0x8000000000000000L : -0x80000000;
|
||||
|
||||
public static int IMinMaxValue<int>.MinValue => MinValue;
|
||||
public static int IMinMaxValue<int>.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