Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/vk1994/Complex
Browse files Browse the repository at this point in the history
  • Loading branch information
viveksingh-a1 committed Mar 21, 2021
2 parents 75c2569 + 65a7acd commit b83fbb2
Showing 1 changed file with 33 additions and 0 deletions.
33 changes: 33 additions & 0 deletions README.md
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;
}
```

0 comments on commit b83fbb2

Please sign in to comment.