1
0
mirror of https://github.com/duke-git/lancet.git synced 2026-02-10 15:52:27 +08:00

feat: add Abs

This commit is contained in:
dudaodong
2023-06-27 10:24:35 +08:00
parent 8f49078eb3
commit 7da931e0a0
5 changed files with 113 additions and 0 deletions

View File

@@ -389,3 +389,18 @@ func ExampleLog() {
// 2.32
// 3
}
func ExampleAbs() {
result1 := Abs(-1)
result2 := Abs(-0.1)
result3 := Abs(float32(0.2))
fmt.Println(result1)
fmt.Println(result2)
fmt.Println(result3)
// Output:
// 1
// 0.1
// 0.2
}