# GoLang – Ceil() Function – Examples & Explanation

Ceil() function is used to find the least integer value greater than or equal to the given input (x – parameter) in Go language. The standard math package of Go programming language has Ceil() function.

## Syntax of Ceil() Function in Go Language

The syntax of Ceil() function in Go Language is:

func Ceil(x float64) float64

Note: float64 is a data type in Go language which has IEEE-754 64-bit floating-point numbers.
Special cases are:
Ceil(±0) = ±0
Ceil(±Inf) = ±Inf
Ceil(NaN) = NaN

## Parameters of Ceil() Function in Go Language

x – Where x is any Valid float64 Input value. This parameter is required.

## Error Handling

If the x parameter is not a number (numeric value) Ceil() function returns an error .
If there is no argument (x – input value) passes to the function, then the compiler will produce an error.

## Return Value of Ceil() Function in Go Language

Ceil() function will return the least integer value greater than or equal to the given input(x – parameter).

## GoLang Ceil() Function Example 1

package main

import "fmt"
import "math"

func main() {
var x float64
x = math.Ceil(1.36)
fmt.Println(x)
}

Output:
2

## GoLang Ceil() Function Example 2

package main

import "fmt"
import "math"

func main() {
var x float64
x = math.Ceil(-66.3389)
fmt.Println(x)
}

Output:
-66

## GoLang Ceil() Function Example 3

package main

import "fmt"
import "math"

func main() {
var x float64
x = math.Ceil(0.378)
fmt.Println(x)
}

Output:
1