Variable Mix + Max Values

08/06/2008 10:38 kinshi88#1
This is a reference for the minimum and maximum values for the Variables in C#.

Code:
[B]C# Type	.Net Framework (System) type	Signed?	Bytes Occupied	Possible Values[/B]
sbyte	System.Sbyte			Yes	1		-128 to 127
short	System.Int16			Yes	2		-32768 to 32767
int	System.Int32			Yes	4		-2147483648 to 2147483647
long	System.Int64			Yes	8		-9223372036854775808 to 9223372036854775807
byte	System.Byte			No	1		0 to 255
ushort	System.Uint16			No	2		0 to 65535
uint	System.UInt32			No	4		0 to 4294967295
ulong	System.Uint64			No	8		0 to 18446744073709551615
float	System.Single			Yes	4		Approximately ±1.5 x 10-45 to ±3.4 x 1038 with 7 significant figures
double	System.Double			Yes	8		Approximately ±5.0 x 10-324 to ±1.7 x 10308 with 15 or 16 significant figures
decimal	System.Decimal			Yes	12		Approximately ±1.0 x 10-28 to ±7.9 x 1028 with 28 or 29 significant figures
char	System.Char			N/A	2		Any Unicode character (16 bit)
bool	System.Boolean			N/A	1 / 2		true or false
*Updated
08/06/2008 11:01 Lateralus#2
Right.
08/06/2008 22:02 kinshi88#3
Lol.. =P
08/07/2008 00:01 Hiyoal#4
Nice, Another way to find them is to use:
Variable.MaxValue
Variable.MinValue

Hiyoal
08/07/2008 00:32 kinshi88#5
Yup, thats how I found them, and just put this here for a reference for others.
08/11/2008 11:33 kinshi88#6
Updated.
08/11/2008 14:00 Hiyoal#7
You got this from softsteel.co.uk yea :p
Thats where I have learned C# from :D

Hiyoal
08/11/2008 23:42 kinshi88#8
Yup, and me too! =P

I was like, huh, that might be useful, since it shows how many bytes it uses etc.
08/22/2008 11:09 glupkotrup#9
Damn lol just when I wanted to upgrade my knowledge... It shows me that the site doesn't exsist :P
08/22/2008 22:14 kinshi88#10
Hmm, try Googling it?
08/24/2008 16:45 tao4229#11
Quote:
Originally Posted by glupkotrup View Post
Damn lol just when I wanted to upgrade my knowledge... It shows me that the site doesn't exsist :P
What upgrade your knowledge from stealing edits to stealing apps?