Jump to content
 







Main menu
   


Navigation  



Main page
Contents
Current events
Random article
About Wikipedia
Contact us
Donate
 




Contribute  



Help
Learn to edit
Community portal
Recent changes
Upload file
 








Search  

































Create account

Log in
 









Create account
 Log in
 




Pages for logged out editors learn more  



Contributions
Talk
 



















Contents

   



(Top)
 


1 Complex-number arithmetic  





2 Language support  





3 References  














Complex data type






العربية

Polski
Русский
Tiếng Vit
 

Edit links
 









Article
Talk
 

















Read
Edit
View history
 








Tools
   


Actions  



Read
Edit
View history
 




General  



What links here
Related changes
Upload file
Special pages
Permanent link
Page information
Cite this page
Get shortened URL
Download QR code
Wikidata item
 




Print/export  



Download as PDF
Printable version
 
















Appearance
   

 






From Wikipedia, the free encyclopedia
 


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

Complex-number arithmetic[edit]

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[edit]

References[edit]

  1. ^ 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. "
  • ^ Python v2.6.5 documentation
  • ^ "Complex and Rational Numbers — Julia Language 0.3.13-pre documentation".
  • ^ "R Data Types". www.w3schools.com. Retrieved 2022-04-26.

  • Retrieved from "https://en.wikipedia.org/w/index.php?title=Complex_data_type&oldid=1184233554"

    Category: 
    Data types
    Hidden categories: 
    Articles needing additional references from June 2023
    All articles needing additional references
    Articles to be expanded from November 2015
    All articles to be expanded
    Articles using small message boxes
     



    This page was last edited on 9 November 2023, at 04:07 (UTC).

    Text is available under the Creative Commons Attribution-ShareAlike License 4.0; additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.



    Privacy policy

    About Wikipedia

    Disclaimers

    Contact Wikipedia

    Code of Conduct

    Developers

    Statistics

    Cookie statement

    Mobile view



    Wikimedia Foundation
    Powered by MediaWiki