1 개요[ | ]
- Go Abs()
Go
CPU
-1.0s
MEM
-0M
-1.0s
Copy
package main
import (
"fmt"
"math"
)
func main() {
fmt.Println(math.Abs(-4.2)) // 4.2
fmt.Println(math.Abs(5)) // 5
fmt.Println(math.Abs(-5)) // 5
}
4.2 5 5
Go
Copy
package main
import (
"fmt"
"math"
)
func main() {
x := math.Abs(-2)
fmt.Printf("%.1f\n", x)
y := math.Abs(2)
fmt.Printf("%.1f\n", y)
}
Loading
2 같이 보기[ | ]
3 참고[ | ]
편집자 Jmnote Jmnote bot
로그인하시면 댓글을 쓸 수 있습니다.