forked from steger/pr3-ws202526
implement myMath module II
parent
ff881930f5
commit
b799d0db38
|
|
@ -0,0 +1,23 @@
|
|||
package myMath
|
||||
|
||||
import "fmt"
|
||||
|
||||
func init() {
|
||||
fmt.Println("initializing myMath")
|
||||
}
|
||||
|
||||
func Add(a, b int) int {
|
||||
return a + b
|
||||
}
|
||||
|
||||
func greater(a, b int) bool {
|
||||
return a > b
|
||||
}
|
||||
|
||||
func Min(a, b int) int {
|
||||
if greater(a, b) {
|
||||
return b
|
||||
} else {
|
||||
return a
|
||||
}
|
||||
}
|
||||
Loading…
Reference in New Issue