Compare commits

...

2 Commits

Author SHA1 Message Date
Micke Nordin ff1a6339ce
Update repor
2 years ago
Micke Nordin 425ec29b0a
Fix includes
2 years ago

@ -1,21 +1,23 @@
<<<<<<< HEAD
# mmathlib
**Compile and run**
*get repo*
```bash
git clone https://code.smolnet.org/micke/mmathlib.git
cd mmathlib
g++ -o fractions fractions.cpp
./fractions
g++ -o cnumber cnumber.cpp
./cnumber
g++ -o matrix matrix.cpp
./matrix
```
**Output**
*Compile and run*
**fractions**
```
g++ -o fractions fractions.cpp
```
***Output***
```
./fractions
7/3=(7/3)
7/3=2.333333333
1/11=(1/11)
@ -29,6 +31,16 @@ g++ -o matrix matrix.cpp
(7/3)/(1/11)=(77/3)
(7/3)/(1/11)=25.66666667
0.75=(3/4)
```
**Complex numbers**
```
g++ -o cnumber cnumber.cpp
./cnumber
```
***Output***
```
a = 3+2i
a* = 3-2i
a*a* = 13
@ -43,6 +55,32 @@ a * b = 18-i
(a * b)* = 18+i
a / b = (6/25)+(17/25)i
(a / b)* = (6/25)-(17/25)i
```
**vectors**
```
g++ -o vector vector.cpp
./vector
```
***output***
```
v:
| 1 |
| 2 |
| i |
w:
| 3 |
| 4 |
| 5 |
v * w:
11+5i
```
**matrices**
```
g++ -o matrix matrix.cpp
./matrix
```
***output***
```
The matrix m:
| 7 | 5 | i |
| 0 | 2 | 0 |

@ -1,5 +1,5 @@
#pragma once
#include "../fractions/fractions.hpp"
#include "fractions.hpp"
#include <iostream>
using namespace std;

@ -1,6 +1,4 @@
#include "matrix.hpp"
#include "../complex-numbers/cnumber.hpp"
#include "../vectors/vector.hpp"
int main() {
vector a = vector(2);

@ -1,4 +1,5 @@
#include "../vectors/vector.hpp"
#pragma once
#include "vector.hpp"
#include <iostream>
#include <sstream>
#include <string>

BIN
vector

Binary file not shown.

@ -1,5 +1,5 @@
#pragma once
#include "../complex-numbers/cnumber.hpp"
#include "cnumber.hpp"
#include <iostream>
using namespace std;
class vector {

Loading…
Cancel
Save