This commit is contained in:
a.pivkin 2025-06-22 17:38:47 +03:00
parent ab0fd9a01a
commit 498d83835a
2 changed files with 14 additions and 1 deletions

View File

@ -6,5 +6,9 @@ func Add(a, b float64) float64 {
}
func Subtract(a, b float64) float64 {
return b - a
return a - b
}
func Multiply(a, b float64) float64 {
return a * b
}

View File

@ -22,3 +22,12 @@ func TestSubtract(t *testing.T) {
t.Errorf("want %f, got %f", want, got)
}
}
func TestMultiply(t *testing.T) {
t.Parallel()
var want float64 = 6
got := calculator.Multiply(2, 3)
if want != got {
t.Errorf("want %f, got %f", want, got)
}
}