vault backup: 2023-11-20 14:31:04

This commit is contained in:
Louis Gallet 2023-11-20 14:31:04 +01:00
parent 227bbc4c71
commit c35124aba6
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -32,6 +32,18 @@ def multiplication2(x: int, y: int) -> int: # Thanks Hugo :p
else
return multiplication(x, y)
def productZ(x, y):
pos = True
if x < 0:
x = -x
pos = False
if y < 0:
y = -y
pos = not pos
m = multiplication(x, y)
if not pos:
m = -m
return m
```
## Exercise 1.3