vault backup: 2023-11-20 13:58:54

This commit is contained in:
Louis Gallet 2023-11-20 13:58:54 +01:00
parent a6fa09555d
commit f21da3c5a3
Signed by: lgallet
SSH Key Fingerprint: SHA256:qnW7pk4EoMRR0UftZLZQKSMUImbEFsiruLC7jbCHJAY

View File

@ -55,6 +55,18 @@ def multiplication2(x: int, y: int) -> int:
return -multiplication(-x, y) return -multiplication(-x, y)
else else
return multiplication(x, y) return multiplication(x, y)
def multiplication2(x: int, y: int) -> int:
if y < 0:
y = -y
if x < 0:
return multiplication(-x, y)
return -multiplication(x, y)
elif x < 0:
return -multiplication(-x, y)
else
return multiplication(x, y)
``` ```
## Exercise 1.3 ## Exercise 1.3