Some programming languages provide a complex data type for complex number storage and arithmetic as a built-in (primitive) data type.

In some programming environments the term complex data type (in contrast to primitive data types) is a synonym for the composite data type.[1][2]

Complex-number arithmetic

A complex variable or value is usually represented as a pair of floating-point numbers. Languages that support a complex data type usually provide special syntax for building such values, and extend the basic arithmetic operations ('+', '−', '×', '÷') to act on them. These operations are usually translated by the compiler into a sequence of floating-point machine instructions or into library calls. Those languages may also provide support for other operations, such as formatting, equality testing, etc. As in mathematics, those languages often interpret a floating-point value as equivalent to a complex value with a zero imaginary part.

Language support

This section needs expansion. You can help by adding to it. (November 2015)


  1. ^ IBM Informix Database Design and Implementation Guide
  2. ^ "Flash 8 Documentation". Archived from the original on 2009-04-27. Retrieved 2009-05-11.
  3. ^ A guide to Fortran IV programming Daniel D. McCracken - 1972 - 288 pages. "The capability provided by Fortran complex operations is a great savings in programming effort in certain problems. "
  4. ^ Python v2.6.5 documentation
  5. ^ "Complex and Rational Numbers — Julia Language 0.3.13-pre documentation".
  6. ^ "R Data Types". Retrieved 2022-04-26.