Project#6 - complexN.h /*struct complexN contains two...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
Sheet1 Page 1 complexN.h /*struct complexN contains two double datas called real and image*/ struct complexN typedef struct complexN complexN_type /*constructor with two parameters, first parameter is for real, and the second is for image*/ complexN_type *complexN_new(double, double) /*constructor with no parameters, it allocates space for complexN_type pointer*/ complexN_type *complexN_n() /*this function calculates and returns sum of two complex numbers*/ complexN_type *complexN_addition(complexN_type *, complexN_type *) /*this function calculates and returns difference of two complex numbers*/ complexN_type *complexN_subtraction(complexN_type *, complexN_type *) /*this function calculates and returns product of two complex numbers*/ complexN_type *complexN_multiplication(complexN_type *, complexN_type *) /*this function prints complex number in the format a+bi*/ void complexN_print(complexN_type *) /*this function returns real part value of a complex num*/ double getReal(complexN_type *) /*this function returns image part value of a complex num*/ double getImage(complexN_type *) /*this function calculates and returns absolute value of a complex number*/ double complexN_absolute(complexN_type *) /*this function calculates roots for a complex number*/ /*roots are parameters passing into the function, not return value*/ /*complexN_roots(complex_number, root1, root2)*/ void complexN_roots(complexN_type *, complexN_type *, complexN_type *) ____________________________________________________________________________________________________ _ complexN.c
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 09/05/2011 for the course EE 150 taught by Professor Lanxiang during the Spring '11 term at Montgomery College.

Page1 / 12

Project#6 - complexN.h /*struct complexN contains two...

This preview shows document pages 1 - 2. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online