mirror of
https://github.com/Hizenberg469/C1-Linux_SYS_Prog-AS-.git
synced 2026-04-20 02:42:23 +03:00
How to make Makefile?
This commit is contained in:
34
Makefile_Assignment/complex_math/complex_math.c
Normal file
34
Makefile_Assignment/complex_math/complex_math.c
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: complex_math.c
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* Version: 1.0
|
||||
* Created: 04/02/24 07:36:03 PM IST
|
||||
* Revision: none
|
||||
* Compiler: gcc
|
||||
*
|
||||
* Author: YOUR NAME (),
|
||||
* Organization:
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
|
||||
#include "complex_math.h"
|
||||
complex_n_t cadd(complex_n_t a, complex_n_t b){
|
||||
complex_n_t res;
|
||||
res.re = a.re + b.re;
|
||||
res.imag = a.imag + b.imag;
|
||||
return res;
|
||||
}
|
||||
|
||||
|
||||
complex_n_t csub(complex_n_t a, complex_n_t b){
|
||||
complex_n_t res;
|
||||
res.re = a.re - b.re;
|
||||
res.imag = a.imag - b.imag;
|
||||
return res;
|
||||
}
|
||||
|
||||
30
Makefile_Assignment/complex_math/complex_math.h
Normal file
30
Makefile_Assignment/complex_math/complex_math.h
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
* =====================================================================================
|
||||
*
|
||||
* Filename: complex_math.h
|
||||
*
|
||||
* Description:
|
||||
*
|
||||
* Version: 1.0
|
||||
* Created: 04/02/24 07:36:29 PM IST
|
||||
* Revision: none
|
||||
* Compiler: gcc
|
||||
*
|
||||
* Author: YOUR NAME (),
|
||||
* Organization:
|
||||
*
|
||||
* =====================================================================================
|
||||
*/
|
||||
|
||||
#ifndef __COMPLEX_MATH__
|
||||
#define __COMPLEX_MATH__
|
||||
|
||||
typedef struct{
|
||||
double re;
|
||||
double imag;
|
||||
} complex_n_t;
|
||||
|
||||
complex_n_t cadd(complex_n_t a, complex_n_t b);
|
||||
complex_n_t csub(complex_n_t a, complex_n_t b);
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user