Add fundamentals

This commit is contained in:
2022-02-23 00:07:11 +01:00
commit 64f5d8346d
3 changed files with 159 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
package calculator
// Add takes two numbers and returns the result of adding them together.
func Add(a, b float64) float64 {
return a + b
}
// Subtract takes two numbers and returns the result of subtracting the second
// from the first.
func Subtract(a, b float64) float64 {
return b - a
}
func Multiply(a, b float64) float64 {
return a * b
}