Go Abs()

1 개요[ | ]

Go Abs()
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
}
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)
}

2 같이 보기[ | ]

3 참고[ | ]

문서 댓글 ({{ doc_comments.length }})
{{ comment.name }} {{ comment.created | snstime }}