answersLogoWhite

0

What are complex data types?

Updated: 8/10/2023
User Avatar

Wiki User

14y ago

Best Answer

The standard library provides a complex number type that encapsulates both the real and imaginary parts of a complex number. All arithmetic operators are overloaded to cater for the complex type:

#include<iostream>

#include<complex>

int main()

{

std::complex<double> c {3.14, 4.2}, d {2.1, -1.2};

std::cout << c + d << std::endl;

}

User Avatar

Wiki User

9y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

14y ago

complex data types are used when manipulation of complex numbers arises, like complex no's have an imaginary part and a real part. that is why complex data types are used because complex no's have two parts like real and imaginary . normal no's dont have this.

A 'complex' data type may also refer to a compound data type, which is made up of multiple primitive types.

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What are complex data types?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

What are enumerated data types in pascal?

Pascal has 4 primitive data types: integer; boolean; char and; real. These 4 provide the basic building blocks for more complex types.


Why String data type cannot be used as built-in data type in C?

Because it isn't a built-in data-type in C. Other examples that aren't built-in data-types: complex numbers, binary trees, associative-arrays.


What is primary data type in C?

The terms "primary data type" and "secondary data type" are not exactly correct when working in C. Instead, C has what are called "primitive data types" or, in some references, "basic types" - types which can be affected by arithmetic operators. Other data types include structs, arrays, and unions. Structs, arrays and unions cannot be affected as a whole by arithmetic operators, although the members within that are primitive data types can be. Pointers can technically be affected by arithmetic operators, particularly +, -, ++ and --, but because their values are expected to be used as addresses, they're not considered to be primitive in nature. There are three primitive data types in C: integers, real numbers and complex numbers. Integers have no decimal points and can be signed or unsigned, and real and complex numbers are signed and have decimal points. Boolean types are represented by integers, most commonly "int" under Posix-style systems. More information about primitive data types can be found in the related links below


What is a complex data structure?

A complex data structure is the kind of structure that has two arrays. One array hols the real part of the complex data and the other array holds the imaginary part.


Is built-in data-type are abstract data-types in java?

All built-in data types are not abstract data types.

Related questions

What are enumerated data types in pascal?

Pascal has 4 primitive data types: integer; boolean; char and; real. These 4 provide the basic building blocks for more complex types.


Structured types in object oriented database?

In object-oriented databases, structured types refer to user-defined data types that can be created to model complex objects with multiple attributes. These structured types are defined by specifying the attributes and their related data types, allowing for the creation of custom objects with specific properties. Structured types in object-oriented databases enable more flexibility and organization in representing complex data structures.


The need for complex data structures?

Explain the need for complex data structures


How many types of view in oracle?

There are two types of views in Oracle based upon from how many tables data are being fetched. 1. Simple view - In this view, data is coming from only one table. 2. Complex view - In this view, data comes from more than one table. That's it. However, Complex views have some limitations. For these follow Oracle documentation.


Why String data type cannot be used as built-in data type in C?

Because it isn't a built-in data-type in C. Other examples that aren't built-in data-types: complex numbers, binary trees, associative-arrays.


What is primary data type in C?

The terms "primary data type" and "secondary data type" are not exactly correct when working in C. Instead, C has what are called "primitive data types" or, in some references, "basic types" - types which can be affected by arithmetic operators. Other data types include structs, arrays, and unions. Structs, arrays and unions cannot be affected as a whole by arithmetic operators, although the members within that are primitive data types can be. Pointers can technically be affected by arithmetic operators, particularly +, -, ++ and --, but because their values are expected to be used as addresses, they're not considered to be primitive in nature. There are three primitive data types in C: integers, real numbers and complex numbers. Integers have no decimal points and can be signed or unsigned, and real and complex numbers are signed and have decimal points. Boolean types are represented by integers, most commonly "int" under Posix-style systems. More information about primitive data types can be found in the related links below


What is a complex data structure?

A complex data structure is the kind of structure that has two arrays. One array hols the real part of the complex data and the other array holds the imaginary part.


Is built-in data-type are abstract data-types in java?

All built-in data types are not abstract data types.


What is datatype.Define various types of data types?

In c language data types are used to specify the tye of data.for ex:int a;It means "a" is a variable of type integer.There are two types of data types in c.They areprimary data typessecondary data typesprimary data types are the built in data types and secondary data types are the user defined data types.eg for primary data types are int,float,char,long,double..and for secondary are arrays,structures,pointers,unions..


What are the different data types?

Theres two types of data, Continuous and discontinuous data.


What are the subject-matters of data structure?

types of data structure types of data structure


Why do you need data types?

Data types specify which types of data that an object or variable can hold. Without data types, it would be impossible to make sure that an application functions properly.