1
0
Fork 0
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:
Ron Zuckerman 2024-02-08 20:16:29 -06:00
parent 6302416e40
commit 484b9716db
No known key found for this signature in database
GPG key ID: 7EC17CB87028ABF8
12 changed files with 72 additions and 10 deletions

View file

@ -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;