1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-04 12:52:28 +08:00

doc: add go playground demo

This commit is contained in:
dudaodong
2023-06-20 14:04:18 +08:00
parent 3050d93703
commit 8f49078eb3
12 changed files with 63 additions and 21 deletions

View File

@@ -173,7 +173,7 @@ func MinBy[T any](slice []T, comparator func(T, T) bool) T {
}
// Sum return sum of passed numbers.
// Play: todo
// Play: https://go.dev/play/p/1To2ImAMJA7
func Sum[T constraints.Integer | constraints.Float](numbers ...T) T {
var sum T
@@ -337,7 +337,7 @@ func Sin(radian float64, precision ...int) float64 {
}
// Log returns the logarithm of base n.
// Play: todo
// Play: https://go.dev/play/p/_d4bi8oyhat
func Log(n, base float64) float64 {
return math.Log(n) / math.Log(base)
}