Standard library / math

math.Ceil()

Smallest integer-valued float not below x. Expected stdout: '-1\n'.

Formal Syntax & Structure

go syntaxgo
func Ceil(x float64) float64

Parameters & Attributes

NameTypeDescription
xfloat64First input operand (or sole input if unary).

Return Value

float64

Smallest integer-valued float not below x.

Working Example

Example Snippetgo
package main
import (  "fmt"  "math")
func main() {  fmt.Println(math.Ceil(-1.2))}
Go Reference