Compute Ceiling
Computes the least integer value greater than or equal to x.
Examples
Filter
console.log(Math.ceil(.95));
// expected output: 1
console.log(Math.ceil(4));
// expected output: 4
console.log(Math.ceil(7.004));
// expected output: 8
console.log(Math.ceil(-7.004));
// expected output: -7
Math.ceil(.95); // 1
Math.ceil(4); // 4
Math.ceil(7.004); // 8
Math.ceil(-0.95); // -0
Math.ceil(-4); // -4
Math.ceil(-7.004); // -7
package main
import (
"fmt"
"math"
)
func main() {
c := math.Ceil(1.49)
fmt.Printf("%.1f", c)
}