-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' of https://github.com/vk1994/Complex
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# Complex | ||
Simple library to parse and work with complex numbers | ||
|
||
## Setup | ||
- Clone the repo `git clone https://github.com/vk1994/Complex.git` | ||
- change directory to downloaded repository `cd Complex` | ||
- create a build directory `mkdir build` | ||
- `cd build` | ||
- generate Makefile using CMake `cmake ..` | ||
- genarate library file `make` | ||
- to install on system `make install` | ||
|
||
## Usage | ||
Once the library is installed, it can be used for calculations on complex numbers. It follows the structure a+bi, where a is real part and b is imaginary part. | ||
It can parse complex numbers of following structure: | ||
1+2i, -6i, 7.2+3.5i, 10, i | ||
|
||
As of now it can add, subtract, multiply and divide complex numbers. | ||
|
||
### Sample | ||
demo.cpp | ||
``` | ||
#include<iostream> | ||
#include "Complex.h" | ||
using namespace std; | ||
int main(){ | ||
Complex c1("3.5+5i"); | ||
Complex c2("10+7i"); | ||
cout<<c1+c2<<'\n'; //13.5+12i | ||
return 0; | ||
} | ||
``` |