v0.2.0 #10

Merged
jono merged 11 commits from v0.2.0-dev into main 2025-06-17 18:36:26 +00:00
2 changed files with 64 additions and 4 deletions
Showing only changes of commit 30a5189928 - Show all commits

View File

@ -394,7 +394,9 @@ class Function:
if not isinstance(scalar, (int, float)): if not isinstance(scalar, (int, float)):
return NotImplemented return NotImplemented
if scalar == 0: if scalar == 0:
raise ValueError("Cannot multiply a function by 0.") result_func = Function(0)
result_func.set_coeffs([0])
return result_func
new_coefficients = self.coefficients * scalar new_coefficients = self.coefficients * scalar