Skip to content

Commit

Permalink
Merge b902600 into 0dfc47d
Browse files Browse the repository at this point in the history
  • Loading branch information
DeviousStoat committed Feb 9, 2024
2 parents 0dfc47d + b902600 commit f562891
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/pydash/numerical.py
Original file line number Diff line number Diff line change
Expand Up @@ -1210,10 +1210,10 @@ def zscore(collection, iteratee=None):

def call_math_operator(value1, value2, op, default):
"""Return the result of the math operation on the given values."""
if not value1:
if value1 is None:
value1 = default

if not value2:
if value2 is None:
value2 = default

if not pyd.is_number(value1):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_numerical.py
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ def test_moving_mean(case, expected):

@parametrize(
"multiplier,multiplicand,expected",
[(10, 5, 50), (None, 1, 1), (None, None, 1), (1.5, 3, 4.5), (-10, 2, -20)],
[(10, 5, 50), (None, 1, 1), (None, None, 1), (1.5, 3, 4.5), (-10, 2, -20), (0, 1, 0)],
)
def test_multiply(multiplier, multiplicand, expected):
assert _.multiply(multiplier, multiplicand) == expected
Expand Down

0 comments on commit f562891

Please sign in to comment.