Skip to content

Commit b58cc5e

Browse files
test, added new fct
1 parent 2fc8357 commit b58cc5e

1 file changed

Lines changed: 32 additions & 0 deletions

File tree

cs_util/example/math.py

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,3 +162,35 @@ def mad(input_data: np.ndarray) -> float:
162162
163163
"""
164164
return np.median(np.abs(input_data - np.median(input_data)))
165+
166+
167+
def add_two_floats(first_value: float, second_value: float) -> float:
168+
"""Add Two Floats.
169+
170+
Add two float values.
171+
172+
Parameters
173+
----------
174+
first_value : float
175+
First float value
176+
second_value : float
177+
Second float value
178+
179+
Returns
180+
-------
181+
float
182+
Result of addition
183+
184+
Raises
185+
------
186+
TypeError
187+
For invalid input types.
188+
189+
"""
190+
fv_is_float = isinstance(first_value, float)
191+
sv_is_float = isinstance(second_value, float)
192+
193+
if not all((fv_is_float, sv_is_float)):
194+
raise TypeError('Inputs must be floats.')
195+
196+
return first_value + second_value

0 commit comments

Comments
 (0)