vault backup: 2023-11-20 14:31:04
This commit is contained in:
parent
227bbc4c71
commit
c35124aba6
@ -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
|
||||
|
Loading…
x
Reference in New Issue
Block a user