17 lines
350 B
Go
17 lines
350 B
Go
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
|
|
}
|