SlideShare ist ein Scribd-Unternehmen logo
1 von 3
ISO C99 includes extensions to support complex numbers. Any floating-point type can be
modified with the keyword complex. Here are some sample functions that work with complex
data and that call some of the associated library functions:
1 #include
2
3 double c_imag(double complex x) {
4 return cimag(x);
5 }
6
7 double c_real(double complex x) {
8 return creal(x);
9 }
10
11 double complex c_sub(double complex x, double complex y) {
12 return x - y;
13 }
When compiled, gcc generates the following assembly code for these functions:
double c_imag(double complex x)
1 c_imag:
2 movapd %xmm1, %xmm0
3 ret
double c_real(double complex x)
4 c_real:
5 rep; ret
double complex c_sub(double complex x, double complex y)
6 c_sub:
7 subsd %xmm2, %xmm0
8 subsd %xmm3, %xmm1
9 ret
Based on these examples, determine the following:
(a) How are complex arguments passed to a function?
(b) How are complex values returned from a function?
Solution
//While using gcc compiler,you need to enable C99 support by using the -std=c99or -std=gnu99
compiler flag.
//You should declare variables firslty, before you use them in the program.
//To give a value into complex, use _Complex_I macro from complex.h
#include <stdio.h>
#include <complex.h>
#include <math.h>
main()
{
double c_imag(double complex x) {
return cimag(x);
}
double c_real(double complex x) {
return creal(x);
}
double complex c_sub(double complex x, double complex y) {
return x - y;
}
}

Weitere ähnliche Inhalte

Ähnlich wie ISO C99 includes extensions to support complex numbers- Any floating-p.docx

Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2PVS-Studio
 
Directive-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous ComputingDirective-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous ComputingRuymán Reyes
 
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...AMD Developer Central
 
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...Francesco Casalegno
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfahmed8651
 
The Ring programming language version 1.10 book - Part 127 of 212
The Ring programming language version 1.10 book - Part 127 of 212The Ring programming language version 1.10 book - Part 127 of 212
The Ring programming language version 1.10 book - Part 127 of 212Mahmoud Samir Fayed
 
Counter Wars (JEEConf 2016)
Counter Wars (JEEConf 2016)Counter Wars (JEEConf 2016)
Counter Wars (JEEConf 2016)Alexey Fyodorov
 
Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil Witecki
 
SFO15-500: VIXL
SFO15-500: VIXLSFO15-500: VIXL
SFO15-500: VIXLLinaro
 

Ähnlich wie ISO C99 includes extensions to support complex numbers- Any floating-p.docx (20)

Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
Analysis of Haiku Operating System (BeOS Family) by PVS-Studio. Part 2
 
C++ Homework Help
C++ Homework HelpC++ Homework Help
C++ Homework Help
 
00_Introduction to Java.ppt
00_Introduction to Java.ppt00_Introduction to Java.ppt
00_Introduction to Java.ppt
 
Directive-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous ComputingDirective-based approach to Heterogeneous Computing
Directive-based approach to Heterogeneous Computing
 
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...Productive OpenCL Programming An Introduction to OpenCL Libraries  with Array...
Productive OpenCL Programming An Introduction to OpenCL Libraries with Array...
 
CPP Homework Help
CPP Homework HelpCPP Homework Help
CPP Homework Help
 
Xgboost
XgboostXgboost
Xgboost
 
Tutorial2
Tutorial2Tutorial2
Tutorial2
 
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
[C++] The Curiously Recurring Template Pattern: Static Polymorphsim and Expre...
 
Klee and angr
Klee and angrKlee and angr
Klee and angr
 
MATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdfMATLAB Questions and Answers.pdf
MATLAB Questions and Answers.pdf
 
The Ring programming language version 1.10 book - Part 127 of 212
The Ring programming language version 1.10 book - Part 127 of 212The Ring programming language version 1.10 book - Part 127 of 212
The Ring programming language version 1.10 book - Part 127 of 212
 
Counter Wars (JEEConf 2016)
Counter Wars (JEEConf 2016)Counter Wars (JEEConf 2016)
Counter Wars (JEEConf 2016)
 
Generative AI for Reengineering Variants into Software Product Lines: An Expe...
Generative AI for Reengineering Variants into Software Product Lines: An Expe...Generative AI for Reengineering Variants into Software Product Lines: An Expe...
Generative AI for Reengineering Variants into Software Product Lines: An Expe...
 
Kamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, codeKamil witecki asynchronous, yet readable, code
Kamil witecki asynchronous, yet readable, code
 
SFO15-500: VIXL
SFO15-500: VIXLSFO15-500: VIXL
SFO15-500: VIXL
 
OpenMP
OpenMPOpenMP
OpenMP
 
Computer Network Assignment Help
Computer Network Assignment HelpComputer Network Assignment Help
Computer Network Assignment Help
 
Writing Macros
Writing MacrosWriting Macros
Writing Macros
 
Lambdas puzzler - Peter Lawrey
Lambdas puzzler - Peter LawreyLambdas puzzler - Peter Lawrey
Lambdas puzzler - Peter Lawrey
 

Mehr von michael1810

Judging from their relative positions in the Periodic Table- which ato.docx
Judging from their relative positions in the Periodic Table- which ato.docxJudging from their relative positions in the Periodic Table- which ato.docx
Judging from their relative positions in the Periodic Table- which ato.docxmichael1810
 
John Corporation has three investments that are classified as noncontr.docx
John Corporation has three investments that are classified as noncontr.docxJohn Corporation has three investments that are classified as noncontr.docx
John Corporation has three investments that are classified as noncontr.docxmichael1810
 
John Smith worked in the stockyard of a large building supply company-.docx
John Smith worked in the stockyard of a large building supply company-.docxJohn Smith worked in the stockyard of a large building supply company-.docx
John Smith worked in the stockyard of a large building supply company-.docxmichael1810
 
John has tremendous technical skills and frequently comes up with valu.docx
John has tremendous technical skills and frequently comes up with valu.docxJohn has tremendous technical skills and frequently comes up with valu.docx
John has tremendous technical skills and frequently comes up with valu.docxmichael1810
 
Joe Frecaso was recently hired as the controller for Larson Cement Com.docx
Joe Frecaso was recently hired as the controller for Larson Cement Com.docxJoe Frecaso was recently hired as the controller for Larson Cement Com.docx
Joe Frecaso was recently hired as the controller for Larson Cement Com.docxmichael1810
 
Java Write a method that takes as a parameter a one dimensional array.docx
Java Write a method that takes as a parameter a one dimensional array.docxJava Write a method that takes as a parameter a one dimensional array.docx
Java Write a method that takes as a parameter a one dimensional array.docxmichael1810
 
Java Programming- 1) Write a recursive method that finds and returns t.docx
Java Programming- 1) Write a recursive method that finds and returns t.docxJava Programming- 1) Write a recursive method that finds and returns t.docx
Java Programming- 1) Write a recursive method that finds and returns t.docxmichael1810
 
JAVA Q2- Write a program that reads strings from the user and writes t.docx
JAVA Q2- Write a program that reads strings from the user and writes t.docxJAVA Q2- Write a program that reads strings from the user and writes t.docx
JAVA Q2- Write a program that reads strings from the user and writes t.docxmichael1810
 
Java Language Which of the following statements is true- Select all th.docx
Java Language Which of the following statements is true- Select all th.docxJava Language Which of the following statements is true- Select all th.docx
Java Language Which of the following statements is true- Select all th.docxmichael1810
 
It-'s virtualization topic Would anyone please expalin what is the di.docx
It-'s virtualization topic  Would anyone please expalin what is the di.docxIt-'s virtualization topic  Would anyone please expalin what is the di.docx
It-'s virtualization topic Would anyone please expalin what is the di.docxmichael1810
 
For each pair of substance identify the substance that is likely to ha.docx
For each pair of substance identify the substance that is likely to ha.docxFor each pair of substance identify the substance that is likely to ha.docx
For each pair of substance identify the substance that is likely to ha.docxmichael1810
 
For each of the requirements listed in the table below- 1- Please iden.docx
For each of the requirements listed in the table below- 1- Please iden.docxFor each of the requirements listed in the table below- 1- Please iden.docx
For each of the requirements listed in the table below- 1- Please iden.docxmichael1810
 
For Contingent Liability- When do you disclose it- When do you record.docx
For Contingent Liability- When do you disclose it- When do you record.docxFor Contingent Liability- When do you disclose it- When do you record.docx
For Contingent Liability- When do you disclose it- When do you record.docxmichael1810
 
For each of the abstract data types (ADTs) that we have analyzed in th.docx
For each of the abstract data types (ADTs) that we have analyzed in th.docxFor each of the abstract data types (ADTs) that we have analyzed in th.docx
For each of the abstract data types (ADTs) that we have analyzed in th.docxmichael1810
 
For each form of transport plot the value of overall benefits against.docx
For each form of transport plot the value of overall benefits against.docxFor each form of transport plot the value of overall benefits against.docx
For each form of transport plot the value of overall benefits against.docxmichael1810
 
Fluid Mechanics The water surface is at the position shown at t - 0 se.docx
Fluid Mechanics The water surface is at the position shown at t - 0 se.docxFluid Mechanics The water surface is at the position shown at t - 0 se.docx
Fluid Mechanics The water surface is at the position shown at t - 0 se.docxmichael1810
 
Fluctuation in inflation can occur in the short or long term- For exam.docx
Fluctuation in inflation can occur in the short or long term- For exam.docxFluctuation in inflation can occur in the short or long term- For exam.docx
Fluctuation in inflation can occur in the short or long term- For exam.docxmichael1810
 
First National Bank charges 11-2 percent compounded monthly on its bus (1).docx
First National Bank charges 11-2 percent compounded monthly on its bus (1).docxFirst National Bank charges 11-2 percent compounded monthly on its bus (1).docx
First National Bank charges 11-2 percent compounded monthly on its bus (1).docxmichael1810
 

Mehr von michael1810 (18)

Judging from their relative positions in the Periodic Table- which ato.docx
Judging from their relative positions in the Periodic Table- which ato.docxJudging from their relative positions in the Periodic Table- which ato.docx
Judging from their relative positions in the Periodic Table- which ato.docx
 
John Corporation has three investments that are classified as noncontr.docx
John Corporation has three investments that are classified as noncontr.docxJohn Corporation has three investments that are classified as noncontr.docx
John Corporation has three investments that are classified as noncontr.docx
 
John Smith worked in the stockyard of a large building supply company-.docx
John Smith worked in the stockyard of a large building supply company-.docxJohn Smith worked in the stockyard of a large building supply company-.docx
John Smith worked in the stockyard of a large building supply company-.docx
 
John has tremendous technical skills and frequently comes up with valu.docx
John has tremendous technical skills and frequently comes up with valu.docxJohn has tremendous technical skills and frequently comes up with valu.docx
John has tremendous technical skills and frequently comes up with valu.docx
 
Joe Frecaso was recently hired as the controller for Larson Cement Com.docx
Joe Frecaso was recently hired as the controller for Larson Cement Com.docxJoe Frecaso was recently hired as the controller for Larson Cement Com.docx
Joe Frecaso was recently hired as the controller for Larson Cement Com.docx
 
Java Write a method that takes as a parameter a one dimensional array.docx
Java Write a method that takes as a parameter a one dimensional array.docxJava Write a method that takes as a parameter a one dimensional array.docx
Java Write a method that takes as a parameter a one dimensional array.docx
 
Java Programming- 1) Write a recursive method that finds and returns t.docx
Java Programming- 1) Write a recursive method that finds and returns t.docxJava Programming- 1) Write a recursive method that finds and returns t.docx
Java Programming- 1) Write a recursive method that finds and returns t.docx
 
JAVA Q2- Write a program that reads strings from the user and writes t.docx
JAVA Q2- Write a program that reads strings from the user and writes t.docxJAVA Q2- Write a program that reads strings from the user and writes t.docx
JAVA Q2- Write a program that reads strings from the user and writes t.docx
 
Java Language Which of the following statements is true- Select all th.docx
Java Language Which of the following statements is true- Select all th.docxJava Language Which of the following statements is true- Select all th.docx
Java Language Which of the following statements is true- Select all th.docx
 
It-'s virtualization topic Would anyone please expalin what is the di.docx
It-'s virtualization topic  Would anyone please expalin what is the di.docxIt-'s virtualization topic  Would anyone please expalin what is the di.docx
It-'s virtualization topic Would anyone please expalin what is the di.docx
 
For each pair of substance identify the substance that is likely to ha.docx
For each pair of substance identify the substance that is likely to ha.docxFor each pair of substance identify the substance that is likely to ha.docx
For each pair of substance identify the substance that is likely to ha.docx
 
For each of the requirements listed in the table below- 1- Please iden.docx
For each of the requirements listed in the table below- 1- Please iden.docxFor each of the requirements listed in the table below- 1- Please iden.docx
For each of the requirements listed in the table below- 1- Please iden.docx
 
For Contingent Liability- When do you disclose it- When do you record.docx
For Contingent Liability- When do you disclose it- When do you record.docxFor Contingent Liability- When do you disclose it- When do you record.docx
For Contingent Liability- When do you disclose it- When do you record.docx
 
For each of the abstract data types (ADTs) that we have analyzed in th.docx
For each of the abstract data types (ADTs) that we have analyzed in th.docxFor each of the abstract data types (ADTs) that we have analyzed in th.docx
For each of the abstract data types (ADTs) that we have analyzed in th.docx
 
For each form of transport plot the value of overall benefits against.docx
For each form of transport plot the value of overall benefits against.docxFor each form of transport plot the value of overall benefits against.docx
For each form of transport plot the value of overall benefits against.docx
 
Fluid Mechanics The water surface is at the position shown at t - 0 se.docx
Fluid Mechanics The water surface is at the position shown at t - 0 se.docxFluid Mechanics The water surface is at the position shown at t - 0 se.docx
Fluid Mechanics The water surface is at the position shown at t - 0 se.docx
 
Fluctuation in inflation can occur in the short or long term- For exam.docx
Fluctuation in inflation can occur in the short or long term- For exam.docxFluctuation in inflation can occur in the short or long term- For exam.docx
Fluctuation in inflation can occur in the short or long term- For exam.docx
 
First National Bank charges 11-2 percent compounded monthly on its bus (1).docx
First National Bank charges 11-2 percent compounded monthly on its bus (1).docxFirst National Bank charges 11-2 percent compounded monthly on its bus (1).docx
First National Bank charges 11-2 percent compounded monthly on its bus (1).docx
 

Kürzlich hochgeladen

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfAyushMahapatra5
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfciinovamais
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingTechSoup
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room servicediscovermytutordmt
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...Sapna Thakur
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajanpragatimahajan3
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Celine George
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024Janet Corral
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphThiyagu K
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhikauryashika82
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...PsychoTech Services
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 

Kürzlich hochgeladen (20)

Class 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdfClass 11th Physics NEET formula sheet pdf
Class 11th Physics NEET formula sheet pdf
 
Activity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdfActivity 01 - Artificial Culture (1).pdf
Activity 01 - Artificial Culture (1).pdf
 
Grant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy ConsultingGrant Readiness 101 TechSoup and Remy Consulting
Grant Readiness 101 TechSoup and Remy Consulting
 
9548086042 for call girls in Indira Nagar with room service
9548086042  for call girls in Indira Nagar  with room service9548086042  for call girls in Indira Nagar  with room service
9548086042 for call girls in Indira Nagar with room service
 
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
BAG TECHNIQUE Bag technique-a tool making use of public health bag through wh...
 
social pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajansocial pharmacy d-pharm 1st year by Pragati K. Mahajan
social pharmacy d-pharm 1st year by Pragati K. Mahajan
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17Advanced Views - Calendar View in Odoo 17
Advanced Views - Calendar View in Odoo 17
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
General AI for Medical Educators April 2024
General AI for Medical Educators April 2024General AI for Medical Educators April 2024
General AI for Medical Educators April 2024
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Z Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot GraphZ Score,T Score, Percential Rank and Box Plot Graph
Z Score,T Score, Percential Rank and Box Plot Graph
 
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in DelhiRussian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
Russian Escort Service in Delhi 11k Hotel Foreigner Russian Call Girls in Delhi
 
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptxINDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
INDIA QUIZ 2024 RLAC DELHI UNIVERSITY.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
IGNOU MSCCFT and PGDCFT Exam Question Pattern: MCFT003 Counselling and Family...
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 

ISO C99 includes extensions to support complex numbers- Any floating-p.docx

  • 1. ISO C99 includes extensions to support complex numbers. Any floating-point type can be modified with the keyword complex. Here are some sample functions that work with complex data and that call some of the associated library functions: 1 #include 2 3 double c_imag(double complex x) { 4 return cimag(x); 5 } 6 7 double c_real(double complex x) { 8 return creal(x); 9 } 10 11 double complex c_sub(double complex x, double complex y) { 12 return x - y; 13 } When compiled, gcc generates the following assembly code for these functions: double c_imag(double complex x) 1 c_imag: 2 movapd %xmm1, %xmm0 3 ret double c_real(double complex x) 4 c_real: 5 rep; ret
  • 2. double complex c_sub(double complex x, double complex y) 6 c_sub: 7 subsd %xmm2, %xmm0 8 subsd %xmm3, %xmm1 9 ret Based on these examples, determine the following: (a) How are complex arguments passed to a function? (b) How are complex values returned from a function? Solution //While using gcc compiler,you need to enable C99 support by using the -std=c99or -std=gnu99 compiler flag. //You should declare variables firslty, before you use them in the program. //To give a value into complex, use _Complex_I macro from complex.h #include <stdio.h> #include <complex.h> #include <math.h> main() { double c_imag(double complex x) { return cimag(x); } double c_real(double complex x) { return creal(x); }
  • 3. double complex c_sub(double complex x, double complex y) { return x - y; } }