bstraehle commited on
Commit
d634b27
·
verified ·
1 Parent(s): a9baea4

Update tools.py

Browse files
Files changed (1) hide show
  1. tools.py +60 -1
tools.py CHANGED
@@ -1 +1,60 @@
1
- #TODO
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ def multiply(a: float, b: float) -> float:
2
+ """Multiply two numbers.
3
+ Args:
4
+ a: first float
5
+ b: second float
6
+
7
+ Returns:
8
+ Result float
9
+ """
10
+ return a * b
11
+
12
+ def add(a: float, b: float) -> float:
13
+ """Add two numbers.
14
+
15
+ Args:
16
+ a: first float
17
+ b: second float
18
+
19
+ Returns:
20
+ Result float
21
+ """
22
+ return a + b
23
+
24
+ def subtract(a: float, b: float) -> float:
25
+ """Subtract two numbers.
26
+
27
+ Args:
28
+ a: first float
29
+ b: second float
30
+
31
+ Returns:
32
+ Result float
33
+ """
34
+ return a - b
35
+
36
+ def divide(a: float, b: float) -> float:
37
+ """Divide two numbers.
38
+
39
+ Args:
40
+ a: first float
41
+ b: second float
42
+
43
+ Returns:
44
+ Result float
45
+ """
46
+ if b == 0:
47
+ raise ValueError("Cannot divide by zero.")
48
+ return a / b
49
+
50
+ def modulus(a: float, b: float) -> float:
51
+ """Get the modulus of two numbers.
52
+
53
+ Args:
54
+ a: first float
55
+ b: second float
56
+
57
+ Returns:
58
+ Result float
59
+ """
60
+ return a % b