Feature/math util (#22)

Development supports the math package
This commit is contained in:
jeffery
2023-04-12 11:10:07 +08:00
committed by GitHub
parent 9a8c60b30a
commit f97913a2bc
30 changed files with 501 additions and 71 deletions

View File

@@ -0,0 +1,23 @@
package mathUtil
import "fmt"
func ExampleRand() {
minInt := 1
maxInt := 100
res1 := Rand(minInt, maxInt)
if res1 >= 1 && res1 < 100 {
fmt.Println("ok")
}
minFloat := 1.0
maxFloat := 10.0
res2 := Rand(minFloat, maxFloat)
if res2 >= 1.0 && res2 < 10.0 {
fmt.Println("ok")
}
// Output:
// ok
// ok
}