Search: in
Data type
Data type Encyclopedia
  Tutorials     Encyclopedia     Dictionary     Directory  
Data_type Email this to a friend      Data_type

Data type

In programming languages a data type is an attribute of a datum which tells the computer (and the programmer) something about the kind of datum it is. This involves setting constraints on the datum, such as what values it can take and what operations may be performed upon it. Common data types may include: integers, floating-point numbers (decimals), and alphanumeric strings. For example, in the Java programming language, the "int" type represents the set of 32-bit integers ranging in value from -2,147,483,648 to 2,147,483,647, as well as the operations that can be performed on integers, such as addition, subtraction, and multiplication. Colors, on the other hand, are represented by three bytes denoting the amounts each of red, green, and blue, and one string representing that color's name; allowable operations include addition and subtraction, but not multiplication.

In a broad sense, a data type defines a set of values, and the allowable operations on those values[1]. Almost all programming languages explicitly include the notion of data type, though different languages may use different terminology. Most programming languages also allow the programmer to define additional data types, usually by combining multiple elements of other types and defining the valid operations of the new data type. For example, a programmer might create a new data type named "Person" that specifies that data interpreted as Person would include a name and a date of birth.

A data type can also be thought of as a constraint placed upon the interpretation of data in a type system, describing representation, interpretation and structure of values or objects stored in computer memory. The type system uses data type information to check correctness of computer programs that access or manipulate the data.

Contents


Machine data types

All data in computers based on digital electronics is represented as bits (alternatives 0 and 1) on the lowest level. The smallest addressable unit of data is a group of bits called a byte (usually an octet, which is 8 bits). The unit processed by machine code instructions is called a word (as of 2008, typically 32 or 64 bits). Most instructions interpret the word as a binary number, such that a 32-bit word can represent unsigned integer values from 0 to 2^{32}-1 or signed integer values from -2^{31} to 2^{31}-1. Because of two's complement, the machine language and machine don't need to distinguish between these unsigned and signed data types for the most part.

There is a specific set of arithmetic instructions that use a different interpretation of the bits in word as a floating-point number.

Primitive types

Composite types

Abstract data types (ADT)

Pointer and reference types

Algebraic types

Object types

Function types

See also

Notes

  1. http://www.sigcse.org/cc2001/PL.html

References

ast:Tipu de datu cs:Datový typ de:Datentyp es:Tipo de dato fr:Type (informatique) ko:??? it:Tipo di dato he:????? ?????? lt:Duomen? strukt?ra hu:Adattípus nl:Datatype ja:???? no:Datatype pl:Typ danych pt:Tipo de dado ru:??? ?????????? sk:Dátový typ sl:Podatkovni tip sv:Datatyp ta:???? ???? zh:????





Source: Wikipedia | The above article is available under the GNU FDL. | Edit this article



Related Links in Data type

Search for Data type in Tutorials
Search for Data type in Encyclopedia
Search for Data type in Dictionary
Search for Data type in Open Directory
Search for Data type in Store
Search for Data type in PriceGig



Help build the largest human-edited directory on the web.
Submit a Site - Open Directory Project - Become an Editor

Advertisement

Advertisement



Data type
Data_type top Data_type

Home - Add TutorGig to Your Site - Disclaimer

©2008-2009 TutorGig.com. All Rights Reserved. Privacy Statement