ceil

Converts a floating point value to an integer.

This function requires the SSE2 instruction set and it can't be inlined.

int
ceil
@trusted pure nothrow
(
T
)
()
if (
isFloatingPoint!T
)

Parameters

value
Type: T

Either a float or a double.

Return Value

Type: int

The smallest integral value that is not less than value.

Examples

assert(ceil(0.2f) == 1);
assert(ceil(0.8f) == 1);
assert(ceil(-0.2f) == 0);
assert(ceil(-0.8f) == 0);

Meta