Google
 
   
Login
Username:

Password:


Lost Password?

Register now!
Search
Main Menu
service
top books
Polls
What do you think about php-deluxe.net?
Excellent!
Cool
Hmm..not bad
What the hell is this?
encyclopedia
recommendation
Freenet DSL
Who's Online
7 user(s) are online (6 user(s) are browsing encyclopedia)

Members: 0
Guests: 7

more...
partner

Primitive type

In computer science, primitive types, as distinct from composite types - are datatypes provided by a programming language as basic building blocks. Depending on the language and its implementation, primitive types may or may not have a one-to-one correspondence with objects in the computer s memory.

Primitive types are also known as built-in types or basic types .

The actual range of primitive types that is available is dependent upon the specific programming language that is being used. For example, in C (programming language), String (computer science) are a composite datatype, whereas in modern dialects of Basic programming language they are a primitive datatype.

Typical primitive types may include:

  • Character (computing) (character, char);
  • Integer (computer science) (integer, int, short, long) with a variety of precision (computer science);
  • floating-point number (float, double, real, double precision);
  • Fixed-point arithmetic (fixed) with a variety of precision (computer science) and a programmer-selected Scale (order of magnitude).
  • Boolean datatype having the values true and false.
  • string (computer science) (string), a sequence of characters, which can be of zero length – containing no characters – if desired);
  • reference (computer science) (also called a Pointer or handle ), a small value referring to another object, possibly a much larger one.
  • More sophisticated types which can be primitive include:

  • Tuples in ML programming language
  • Linked lists in Lisp programming language
  • complex numbers in Fortran programming language, C programming language#C99, Python programming language
  • rational numbers in Lisp programming language
  • first class functions, Closure (computer science)s, Continuations in Functional programming languages such as Lisp programming language and ML programming language
  • One usually expect operations on primitive types to be the fastest language contructs there are. Integer addition, for example, can be performed as a single machine instruction, and some central processing unit offer specific instructions to process sequences of characters with a single instruction. In particular, the C programming language standard mentions that a ``plain int object has the natural size suggested by the architecture of the execution environment . This means that int is likely to be 32 bits long on a 32-bit architecture.

    Most languages do not allow the behaviour or capabilities of primitive types to be modified by programs. Exceptions include Smalltalk, which permits primitive datatypes to be extended within a program, adding to the operations that can be performed on them or even redefining the built-in operations.