Skip to content

Commit b039c61

Browse files
authored
Update README.md
Adding More functionalities with explanations
1 parent c68c8ff commit b039c61

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

README.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ print(number)
3737
number = Complex(re=3, im=-2.4, restore=False) # restore argument is by default True, whenever an error occurs on operation, the last result will be restored to the object, else if it is False then the object will be simply None.
3838
# Instanciation 6
3939
number = Complex.fromComplex(4 - 3j - 2) # Real = 2, Imaginary = -3
40+
# Keep in mind that the imaginary part 'j' must be always multiplied with a coefficient as follows
41+
number = Complex.fromComplex(1 - 1j)
4042
```
4143
### Basic operations
4244
```python
@@ -77,6 +79,9 @@ print(num1)
7779
print('con({}) = {}'.format(num2, num2.con()))
7880
# Module of a complex number
7981
print('mod({}) = {}'.format(num2, num2.mod()))
82+
# You can also make basic operations with non instanciated complex numbers like this
83+
num1 *= (1 - 1j)
84+
print(num1)
8085
```
8186
### Comparisons of Complex numbers
8287
```python
@@ -94,6 +99,8 @@ if(num1 <= num2): print('({}) <= ({})'.format(num1, num2))
9499
if(num1 == num2): print('({}) == ({})'.format(num1, num2))
95100
# Not equal
96101
if(num1 != num2): print('({}) != ({})'.format(num1, num2))
102+
# You can also make comparisons with non instanciated complex numbers like this
103+
if(num1 > (1 - 3j)): print('({}) != ({})'.format(num1, (1 - 3j)))
97104
```
98105
### Solving linear equation and second degree equation
99106
#### Importing solve function

0 commit comments

Comments
 (0)