bitfield/ftl-fundamentals/calculator/calculator.go

17 lines
350 B
Go
Raw Permalink Normal View History

2022-02-23 00:07:11 +01:00
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
}