What’s the range of each value data type in C#?

What’s the range of each value data type in C#

These are the basic data types in C# and their range:


KeywordClass Range
boolSystem.Booleantrue and false
byteSystem.Byte0 to 255
sbyteSystem.SByte-128 to 127
shortSystem.Int16-32768 to 32767
ushortSystem.Uint160 to 65535
intSystem.Int32-2,147,483,648 to 2,147,483,647
uintSystem.UInt320 to 4,294,967,295
longSystem.Int64-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
ulongSystem.UInt640 to 18,446,744,073,709,551,615
decimalSystem.Decimal-79,228,162,514,264,337,593,543,950,335 to 79,228,162,514,264,337,593,543,950,335
doubleSystem.Double-1.79769313486232e308 to 1.79769313486232e308
floatSystem.Single-3.402823e38 to 3.402823e38
charSystem.Char0 to 65535
Nathan Pakovskie is an esteemed senior developer and educator in the tech community, best known for his contributions to Geekpedia.com. With a passion for coding and a knack for simplifying complex tech concepts, Nathan has authored several popular tutorials on C# programming, ranging from basic operations to advanced coding techniques. His articles, often characterized by clarity and precision, serve as invaluable resources for both novice and experienced programmers. Beyond his technical expertise, Nathan is an advocate for continuous learning and enjoys exploring emerging technologies in AI and software development. When he’s not coding or writing, Nathan engages in mentoring upcoming developers, emphasizing the importance of both technical skills and creative problem-solving in the ever-evolving world of technology. Specialties: C# Programming, Technical Writing, Software Development, AI Technologies, Educational Outreach

Leave a Reply

Your email address will not be published. Required fields are marked *

Back To Top