How to make Makefile?

This commit is contained in:
2024-02-04 20:19:52 +05:30
parent ebafca3461
commit dee48d5d1b
8 changed files with 257 additions and 0 deletions

View 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;
}

View 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