feat: add Log function

This commit is contained in:
dudaodong committed 2023-06-06 14:34:40 +08:00
1 parent 2f6ee84443
commit a6a8fd88bc
3 files changed
+29

No files matched your search

+6
View File
@@ -323,3 +323,9 @@ func Cos(radian float64, precision ...int) float64 {
func Sin(radian float64, precision ...int) float64 {
return Cos((math.Pi / 2) - radian)
}
// Log retur the logarithm of base n.
// Play: todo
func Log(n, base float64) float64 {
return math.Log(n) / math.Log(base)
}