package main
import (
"fmt"
"math"
)
func main() {
fmt.Print("Ceil 切り上げ\n")
fmt.Printf("%.1f\n%.1f\n\n", math.Ceil(1.1), math.Ceil(1.9))
fmt.Print("Floor 切り捨て\n")
fmt.Printf("%.1f\n%.1f\n\n", math.Floor(1.1), math.Floor(1.9))
fmt.Print("Round 四捨五入\n")
fmt.Printf("%.1f\n%.1f\n\n", math.Round(1.1), math.Round(1.9))
}
Ceil 切り上げ
2.0
2.0
Floor 切り捨て
1.0
1.0
Round 四捨五入
1.0
2.0