Add fundamentals
This commit is contained in:
16
ftl-fundamentals/calculator/calculator.go
Normal file
16
ftl-fundamentals/calculator/calculator.go
Normal 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
|
||||
}
|
Reference in New Issue
Block a user