Open main menu
Home
Random
Recent changes
Special pages
Community portal
Preferences
About Wikipedia
Disclaimers
Incubator escapee wiki
Search
User menu
Talk
Dark mode
Contributions
Create account
Log in
Editing
Programming language
(section)
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
====Commonly supported types==== {{See also|Primitive data type}} Early programming languages often supported only built-in, numeric types such as the [[integer]] (signed and unsigned) and [[floating point]] (to support operations on [[real number]]s that are not integers). Most programming languages support multiple sizes of floats (often called [[Single-precision floating-point format|float]] and [[Double-precision floating-point format|double]]) and integers depending on the size and precision required by the programmer. Storing an integer in a type that is too small to represent it leads to [[integer overflow]]. The most common way of representing negative numbers with signed types is [[twos complement]], although [[ones complement]] is also used.{{sfn|Sebesta|2012|pp=246–247}} Other common types include [[Boolean data type|Boolean]]—which is either true or false—and [[Character (computing) |character]]—traditionally one [[byte]], sufficient to represent all [[ASCII]] characters.{{sfn|Sebesta|2012|p=249}} [[array (data type)|Arrays]] are a data type whose elements, in many languages, must consist of a single type of fixed length. Other languages define arrays as references to data stored elsewhere and support elements of varying types.{{sfn|Sebesta|2012|p=260}} Depending on the programming language, sequences of multiple characters, called [[string (computing)|strings]], may be supported as arrays of characters or their own [[primitive type]].{{sfn|Sebesta|2012|p=250}} Strings may be of fixed or variable length, which enables greater flexibility at the cost of increased storage space and more complexity.{{sfn|Sebesta|2012|p=254}} Other data types that may be supported include [[list (computing)|lists]],{{sfn|Sebesta|2012|pp=281–282}} [[associative arrays|associative (unordered) arrays]] accessed via keys,{{sfn|Sebesta|2012|pp=272–273}} [[record (computer science)|record]]s in which data is mapped to names in an ordered structure,{{sfn|Sebesta|2012|pp=276–277}} and [[tuple]]s—similar to records but without names for data fields.{{sfn|Sebesta|2012|p=280}} [[Pointer (computer programming)|Pointer]]s store memory addresses, typically referencing locations on the [[Heap (programming)|heap]] where other data is stored.{{sfn|Sebesta|2012|pp=289–290}} The simplest [[user-defined type]] is an [[Ordinal data type|ordinal type]], often called an [[enumeration]], whose values can be mapped onto the set of positive integers.{{sfn|Sebesta|2012|p=255}} Since the mid-1980s, most programming languages also support [[abstract data types]], in which the representation of the data and operations are [[information hiding|hidden from the user]], who can only access an [[Interface (computing)|interface]].{{sfn|Sebesta|2012|pp=244–245}} The benefits of [[data abstraction]] can include increased reliability, reduced complexity, less potential for [[name collision]], and allowing the underlying [[data structure]] to be changed without the client needing to alter its code.{{sfn|Sebesta|2012|p=477}}
Edit summary
(Briefly describe your changes)
By publishing changes, you agree to the
Terms of Use
, and you irrevocably agree to release your contribution under the
CC BY-SA 4.0 License
and the
GFDL
. You agree that a hyperlink or URL is sufficient attribution under the Creative Commons license.
Cancel
Editing help
(opens in new window)