Data Type Ranges (2023)

  • Article

The Microsoft C++ 32-bit and 64-bit compilers recognize the types in the table later in this article.

  • int (unsigned int)

  • __int8 (unsigned __int8)

  • __int16 (unsigned __int16)

  • __int32 (unsigned __int32)

  • __int64 (unsigned __int64)

  • short (unsigned short)

  • long (unsigned long)

  • long long (unsigned long long)

If its name begins with two underscores (__), a data type is non-standard.

The ranges that are specified in the following table are inclusive-inclusive.

Type NameBytesOther NamesRange of Values
int4signed-2,147,483,648 to 2,147,483,647
unsigned int4unsigned0 to 4,294,967,295
__int81char-128 to 127
unsigned __int81unsigned char0 to 255
__int162short, short int, signed short int-32,768 to 32,767
unsigned __int162unsigned short, unsigned short int0 to 65,535
__int324signed, signed int, int-2,147,483,648 to 2,147,483,647
unsigned __int324unsigned, unsigned int0 to 4,294,967,295
__int648long long, signed long long-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
unsigned __int648unsigned long long0 to 18,446,744,073,709,551,615
bool1nonefalse or true
char1none-128 to 127 by default

0 to 255 when compiled by using /J

signed char1none-128 to 127
unsigned char1none0 to 255
short2short int, signed short int-32,768 to 32,767
unsigned short2unsigned short int0 to 65,535
long4long int, signed long int-2,147,483,648 to 2,147,483,647
unsigned long4unsigned long int0 to 4,294,967,295
long long8none (but equivalent to __int64)-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
unsigned long long8none (but equivalent to unsigned __int64)0 to 18,446,744,073,709,551,615
enumvariesnone
float4none3.4E +/- 38 (7 digits)
double8none1.7E +/- 308 (15 digits)
long doublesame as doublenoneSame as double
wchar_t2__wchar_t0 to 65,535

Depending on how it's used, a variable of __wchar_t designates either a wide-character type or multibyte-character type. Use the L prefix before a character or string constant to designate the wide-character-type constant.

signed and unsigned are modifiers that you can use with any integral type except bool. Note that char, signed char, and unsigned char are three distinct types for the purposes of mechanisms like overloading and templates.

The int and unsigned int types have a size of four bytes. However, portable code should not depend on the size of int because the language standard allows this to be implementation-specific.

C/C++ in Visual Studio also supports sized integer types. For more information, see __int8, __int16, __int32, __int64 and Integer Limits.

For more information about the restrictions of the sizes of each type, see Built-in types.

The range of enumerated types varies depending on the language context and specified compiler flags. For more information, see C Enumeration Declarations and Enumerations.

See also

Keywords
Built-in types

Feedback

Submit and view feedback for

FAQs

What is a range data type? ›

In this article
Type NameBytesRange of Values
unsigned short20 to 65,535
long4-2,147,483,648 to 2,147,483,647
unsigned long40 to 4,294,967,295
long long8-9,223,372,036,854,775,808 to 9,223,372,036,854,775,807
21 more rows
Aug 2, 2021

What are the data type answers? ›

What is a data type? In software programming, data type refers to the type of value a variable has and what type of mathematical, relational or logical operations can be applied without causing an error.

What are the 5 main data types? ›

Basic Data Types
  • Integer.
  • Double or Real.
  • String.
  • Boolean.
  • Date/Time.
  • Object.
  • Variant.

How do you find the range of data types? ›

The range is calculated by subtracting the lowest value from the highest value.

What is range data type in Excel? ›

A range is a group of cells that can be from a single row or from a single column also it can be a combination of rows and columns. VBA range is a method that is used to fetch data from specific rows columns or a table and it is also used to assign the values to that range.

What is a data type with example? ›

A data type is a classification of data which tells the compiler or interpreter how the programmer intends to use the data. Most programming languages support various types of data, including integer, real, character or string, and Boolean.

What are the 3 main data types? ›

Common data types
Data TypeDefinition
String (str or text)Sequence of characters, digits, or symbols—always treated as text
Boolean (bool)True or false values
Enumerated type (enum)Small set of predefined unique values (elements or enumerators) that can be text-based or numerical
8 more rows
Mar 2, 2022

What is the range of integer? ›

The INTEGER data type stores whole numbers that range from -2,147,483,647 to 2,147,483,647 for 9 or 10 digits of precision. The number 2,147,483,648 is a reserved value and cannot be used. The INTEGER value is stored as a signed binary integer and is typically used to store counts, quantities, and so on.

What is basic data type? ›

The basic data types are also known as fundamental or primary data types. Basic data types are used in the C language for storing the available values in decimal as well as integer forms, and these provide support for both – unsigned and signed literals.

What is a simple data type? ›

Simple data types represent a single value. Simple data types used to create policies: Integer. The integer data type represents a positive whole number or its negative value. Examples of integers are 0 , 1 , 2 , 3 and 4 . Float.

What data type should I use? ›

The basic strategy for selecting the best data type is to select the smallest data type that matches the kind of data you have and that allows for all the feasible values of your data. For example, customer_id in our sample sales table is a whole number starting with 0.

How do you set a data range? ›

Create a named range from selected cells in a worksheet
  1. Select the range you want to name, including the row or column labels.
  2. Click Formulas > Create from Selection.
  3. In the Create Names from Selection dialog box, select the checkbox (es) depending on the location of your row/column header. ...
  4. Click OK.

Where is the range on a data set? ›

The range of a data set is the difference between the maximum and the minimum values. It measures variability using the same units as the data. Larger values represent greater variability.

Is range a data type or function? ›

Definition. The range() function is a built-in-function used in python, it is used to generate a sequence of numbers. If the user wants to generate a sequence of numbers given the starting and the ending values then they can give these values as parameters of the range() function.

What are the 2 main types of data? ›

There are two general types of data – quantitative and qualitative and both are equally important. You use both types to demonstrate effectiveness, importance or value.

What are the 11 data types? ›

Contact MySQL |
  • Numeric Data Type Syntax.
  • Integer Types (Exact Value) - INTEGER, INT, SMALLINT, TINYINT, MEDIUMINT, BIGINT.
  • Fixed-Point Types (Exact Value) - DECIMAL, NUMERIC.
  • Floating-Point Types (Approximate Value) - FLOAT, DOUBLE.
  • Bit-Value Type - BIT.
  • Numeric Type Attributes.
  • Out-of-Range and Overflow Handling.

How do I select a range in Excel? ›

To select a range, select a cell, then with the left mouse button pressed, drag over the other cells. Or use the Shift + arrow keys to select the range. To select non-adjacent cells and cell ranges, hold Ctrl and select the cells.

How do you identify a range in Excel? ›

You can find a named range by using the Go To feature—which navigates to any named range throughout the entire workbook. You can find a named range by going to the Home tab, clicking Find & Select, and then Go To. Or, press Ctrl+G on your keyboard.

What are the 8 simple data types? ›

Primitive Data Types. The eight primitives defined in Java are int, byte, short, long, float, double, boolean and char. These aren't considered objects and represent raw values.

What are few examples of data? ›

Data can come in the form of text, observations, figures, images, numbers, graphs, or symbols. For example, data might include individual prices, weights, addresses, ages, names, temperatures, dates, or distances.

What are 10 types of data? ›

10 data types
  • Integer. Integer data types often represent whole numbers in programming. ...
  • Character. In coding, alphabet letters denote characters. ...
  • Date. This data type stores a calendar date with other programming information. ...
  • Floating point (real) ...
  • Long. ...
  • Short. ...
  • String. ...
  • Boolean.
Jun 24, 2022

What are the 4 most common data types? ›

4 Types of Data: Nominal, Ordinal, Discrete, Continuous | upGrad blog.

What are only 3 data types in Excel? ›

Excel data types are the four different kinds of values in Microsoft Excel. The four types of data are text, number, logical and error. You may perform different functions with each type, so it's important to know which ones to use and when to use them.

What are the three data types in Excel? ›

Summary of data types
Data type in ExcelData type in DAX
Whole NumberA 64 bit (eight-bytes) integer value 1, 2
Decimal NumberA 64 bit (eight-bytes) real number 1, 2
TRUE/FALSEBoolean
TextString
3 more rows

What is range of the numbers? ›

The range is the difference between the highest and lowest values in a set of numbers. To find it, subtract the lowest number in the distribution from the highest.

Is range only for integers? ›

The range function only works with integers. Other data types like float numbers cannot be used. There are three range parameters: start, stop, and step. Only stop is required.

What is the range of short data type? ›

short: The short data type is a 16-bit signed two's complement integer. It has a minimum value of -32,768 and a maximum value of 32,767 (inclusive).

What data type is single? ›

Remarks. Use the Single data type to contain floating-point values that do not require the full data width of Double . In some cases the common language runtime might be able to pack your Single variables closely together and save memory consumption. The default value of Single is 0.

What type of data is most important? ›

Here's a look at some of the most important types:
  • Historical data. ...
  • Internal business processes. ...
  • Marketing data. ...
  • Product performance. ...
  • Sales data. ...
  • Social data. ...
  • Technology usage. ...
  • Unstructured data. This refers to information that doesn't fit into a predefined structure, like word documents or email messages.

What is the data type for numbers? ›

The nonintegral numeric data types are Decimal (128-bit fixed point), Single Data Type (32-bit floating point), and Double Data Type (64-bit floating point). They are all signed types. If a variable can contain a fraction, declare it as one of these types.

What is the range name? ›

A range name is simply a name you assign to a range of data and is much easier to remember than a cell address.

How do you select a range in a data table? ›

You can also click anywhere in the table, and then press CTRL+A to select the table data in the entire table, or you can click the top-left most cell in the table, and then press CTRL+SHIFT+END. Press CTRL+A twice to select the entire table, including the table headers.

How do you fill data from a range? ›

Fill formulas into adjacent cells

You can use the Fill command to fill a formula into an adjacent range of cells. Simply do the following: Select the cell with the formula and the adjacent cells you want to fill. Click Home > Fill, and choose either Down, Right, Up, or Left.

What is data range examples? ›

The range in statistics for a given data set is the difference between the highest and lowest values. For example, if the given data set is {2,5,8,10,3}, then the range will be 10 – 2 = 8. Thus, the range could also be defined as the difference between the highest observation and lowest observation.

What is range used for in data? ›

Range, which is the difference between the largest and smallest value in the data set, describes how well the central tendency represents the data. If the range is large, the central tendency is not as representative of the data as it would be if the range was small.

What is range and mode of a data set? ›

The mode is the value that appears the most number of times in a data set. The range is the difference between the largest value and the smallest value.

What data type does range return? ›

The range() function returns a sequence of numbers, starting from 0 by default, and increments by 1 (by default), and stops before a specified number.

Which of the following are types of range? ›

Detailed Solution
  • Inclusive range:- It means lower and upper limits are included in the range.
  • Specific category:- It means output obtained per unit of input given. Example:- distance travelled per unit of fuel consumption.

What data type has the largest range? ›

Explanation: Longtext has largest range.

What is an example of range data? ›

The range in statistics for a given data set is the difference between the highest and lowest values. For example, if the given data set is {2,5,8,10,3}, then the range will be 10 – 2 = 8. Thus, the range could also be defined as the difference between the highest observation and lowest observation.

What is range data type in Python? ›

What Is Range In Python? It is an in-built function in Python which returns a sequence of numbers starting from 0 and increments to 1 until it reaches a specified number. The most common use of range function is to iterate sequence type. It is most commonly used in for and while loops.

What is the range of data type in SQL? ›

In this article
Data typeRangeStorage
bigint-9,223,372,036,854,775,808 to 9,223,372,036,854,775,8078 Bytes
int-2,147,483,648 to 2,147,483,6474 Bytes
smallint-32,768 to 32,7672 Bytes
tinyint0 to 2551 Byte
May 23, 2023

What is range examples and answers? ›

The Range is the difference between the lowest and highest values. Example: In {4, 6, 9, 3, 7} the lowest value is 3, and the highest is 9. So the range is 9 − 3 = 6. It is that simple!

What is range an example of? ›

The range is a specific example of order statistics.

What is the range of the values? ›

When you are given various values, the range of those values is how big the difference is between the largest value and the smallest value. In other words, the range is what you get when you subtract the smallest value in the group from the largest value in the group.

What is the example of range in Python? ›

The most common form is range(n) , for integer n, which returns a numeric series starting with 0 and extending up to but not including n, e.g. range(5) returns 0, 1, 2, 3, 4 . Or put another way, range(n) returns a series of n numbers, starting with 0`.

How do you set a range in Python? ›

Steps to use range() function
  1. Pass start and stop values to range() For example, range(0, 6) . Here, start=0 and stop = 6 . ...
  2. Pass the step value to range() The step Specify the increment. ...
  3. Use for loop to access each number. Use for loop to iterate and access a sequence of numbers returned by a range() .
Mar 17, 2022

What is range and variable? ›

The range of a distribution with a discrete random variable is the difference between the maximum value and the minimum value. For a distribution with a continuous random variable, the range is the difference between the two extreme points on the distribution curve, where the value of the function falls to zero.

What is the range of single data type? ›

Holds signed IEEE 32-bit (4-byte) single-precision floating-point numbers ranging in value from -3.4028235E+38 through -1.401298E-45 for negative values and from 1.401298E-45 through 3.4028235E+38 for positive values.

How to check data range in SQL? ›

The SQL Between operator is used to test whether an expression is within a range of values. This operator is inclusive, so it includes the start and end values of the range. The values can be of textual, numeric type, or dates. This operator can be used with SELECT, INSERT, UPDATE, and DELETE command.

What is the range of string data type? ›

A string can contain from 0 to approximately two billion (2 ^ 31) Unicode characters.

References

Top Articles
Latest Posts
Article information

Author: Jerrold Considine

Last Updated: 03/12/2023

Views: 6352

Rating: 4.8 / 5 (58 voted)

Reviews: 89% of readers found this page helpful

Author information

Name: Jerrold Considine

Birthday: 1993-11-03

Address: Suite 447 3463 Marybelle Circles, New Marlin, AL 20765

Phone: +5816749283868

Job: Sales Executive

Hobby: Air sports, Sand art, Electronics, LARPing, Baseball, Book restoration, Puzzles

Introduction: My name is Jerrold Considine, I am a combative, cheerful, encouraging, happy, enthusiastic, funny, kind person who loves writing and wants to share my knowledge and understanding with you.