mirror of
https://github.com/beefytech/Beef.git
synced 2025-06-25 02:58:02 +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
|
@ -1,7 +1,7 @@
|
|||
namespace System
|
||||
{
|
||||
#unwarn
|
||||
struct UInt : uint, IInteger, IUnsigned, IHashable, IFormattable, IIsNaN, IParseable<uint, ParseError>, IParseable<uint>
|
||||
struct UInt : uint, IInteger, IUnsigned, IHashable, IFormattable, IIsNaN, IParseable<uint, ParseError>, IParseable<uint>, IMinMaxValue<uint>
|
||||
{
|
||||
public enum ParseError
|
||||
{
|
||||
|
@ -14,6 +14,9 @@ namespace System
|
|||
public const uint MaxValue = (sizeof(uint) == 8) ? 0xFFFFFFFFFFFFFFFFUL : 0xFFFFFFFFL;
|
||||
public const uint MinValue = 0;
|
||||
|
||||
public static uint IMinMaxValue<uint>.MinValue => MinValue;
|
||||
public static uint IMinMaxValue<uint>.MaxValue => MaxValue;
|
||||
|
||||
public bool IsNull()
|
||||
{
|
||||
return this == 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue