forked from steger/pr3-ws202526
implement myMath module II
parent
c2ebf023c4
commit
a58bbe5e2e
|
|
@ -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