Url

Datatype

What is this site? It is generaly simplier version of wikipedia. You will find there selected articles. Enjoy!

For other uses, see Data type (disambiguation).
This article may contain parts that are misleading. Please help clarify this article according to any suggestions provided on the talk page.
Crystal Clear app kedit.svg
This article may need to be rewritten entirely to comply with Wikipedia's quality standards. You can help. The discussion page may contain suggestions. (September 2009)

In computer programming, a data type (or datatype) is a classification identifying one of various types of data, such as floating-point, integer, or Boolean, stating the possible values for that type, the operations that can be done on that type, and the way the values of that type are stored.

Contents

Overview

Almost all programming languages explicitly include the notion of data type, though different languages may use different terminology. Common data types may include:

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.

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 "complex number" that would include real and imaginary parts.

A data type also represents 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.

Classes of data types

Algebraic data types

Main article: Algebraic data type

Function types

Main article: Function type

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 usually 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 232 − 1 or signed integer values from − 231 to 231 − 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.

Object types

Main article: Object (computer science)
Further information: Class (computer science)

Pointer and reference data types

Main article: Reference (computer science)
Further information: Pointer

Primitive data types

Main article: Primitive data type

See also

Wikimedia Commons has media related to: Data types

References

  1. ^ http://dictionary.reference.com/browse/data+type

Further reading

v  d  e
Data types
Uninterpreted
Bit · Byte · Word
Numeric
Text
Pointer
Composite
Other
Related topics
Retrieved from "http://en.wikipedia.org/wiki/Data_type"

All text are available under the terms of the GNU Free Documentation License. Hope this site help you/
laptopy - Noclegi Świnoujście, Apartamenty Świnoujście , Kwatery Świonoujście - ustka kwatery - Kraków noclegi - skorzystaj z naszej profesjonalnej oferty! - Zdrowie na talerzu to kiełki polecamy kiełki - noclegi Międzyzdroje - praca Gorzów Wielkopolski - praca Jelenia Góra - praca Kalisz - Najtaniej prawo karne tylko u nas! - Biurka antyki - Systemy regałów regały magazynowe Atrakcyjne ceny - Regały półkowe - szafy przesuwne kraków - producent kostiumów kąpielowych - Najlepsze odżywki w mieście!