1 // =================================
 2 // Copyright (c) 2024 Seppo Laakko
 3 // Distributed under the MIT license
 4 // =================================
 5 
 6 namespace System
 7 {
 8     public inline constexpr byte MinValue(byte)
 9     {
10         return cast<byte>(0);
11     }
12 
13     public inline constexpr byte MaxValue(byte)
14     {
15         return cast<byte>(255u);
16     }
17 
18     public inline constexpr sbyte MinValue(sbyte)
19     {
20         return cast<sbyte>(128u);
21     }
22 
23     public inline constexpr sbyte MaxValue(sbyte)
24     {
25         return cast<sbyte>(127);
26     }
27 
28     public inline constexpr short MinValue(short)
29     {
30         return cast<short>(32768u);
31     }
32 
33     public inline constexpr short MaxValue(short)
34     {
35         return cast<short>(32767);
36     }
37 
38     public inline constexpr ushort MinValue(ushort)
39     {
40         return cast<ushort>(0);
41     }
42 
43     public inline constexpr ushort MaxValue(ushort)
44     {
45         return cast<ushort>(65535u);
46     }
47 
48     public inline constexpr int MinValue(int)
49     {
50         return cast<int>(2147483648u);
51     }
52 
53     public inline constexpr int MaxValue(int)
54     {
55         return cast<int>(2147483647);
56     }
57 
58     public inline constexpr uint MinValue(uint)
59     {
60         return cast<uint>(0);
61     }
62 
63     public inline constexpr uint MaxValue(uint)
64     {
65         return cast<uint>(4294967295u);
66     }
67 
68     public inline constexpr long MinValue(long)
69     {
70         return cast<long>(9223372036854775808u);
71     }
72 
73     public inline constexpr long MaxValue(long)
74     {
75         return cast<long>(9223372036854775807);
76     }
77 
78     public inline constexpr ulong MinValue(ulong)
79     {
80         return cast<ulong>(0);
81     }
82 
83     public inline constexpr ulong MaxValue(ulong)
84     {
85         return cast<ulong>(18446744073709551615u);
86     }
87     
88     public inline constexpr I MinValue<I>()
89     {
90         return MinValue(cast<I>(0));
91     }
92 
93     public inline constexpr I MaxValue<I>()
94     {
95         return MaxValue(cast<I>(0));
96     }