Back
Close

C# Professional - Numbers

talent-agile
2,510 views
Next: Arithmetic overflow

Numeric types in C#

C# offers multiple numeric types, for integer data types and non-integer data types.

Integer Data Types

TypeDescriptionMinimum ValueMaximum Value
byteUnsigned byte0255
sbyteSigned byte-128127
shortSigned byte-32 76832 767
ushortUnsigned byte065 535
intSigned byte-2 147 483 6482 147 483 647
uintUnsigned byte04 294 967 295
longSigned byte-9x1089x108
ulongUnsigned byte01,8x1019

Non-integer Data Types

All non-integer data types are signed.

TypeDescriptionScalePrecision
floatSingle Precision Number±1.5x10-45 to ±3.4x10387 digits
doubleDouble Precision Number±5x10-324 to ±1.7x1030815 or 16 digits
decimalDecimal Number±10-28 to ±7.9x102828 or 29 digits
Create your playground on Tech.io
This playground was created on Tech.io, our hands-on, knowledge-sharing platform for developers.
Go to tech.io
codingame x discord
Join the CodinGame community on Discord to chat about puzzle contributions, challenges, streams, blog articles - all that good stuff!
JOIN US ON DISCORD
Online Participants