def const dash autodiff pure ceiling(a: number): number
Returns the smallest integer greater than or equal to a.
a: The number to round up.
Examples
show table "" with
ceiling(-1.7)
ceiling(-0.5)
ceiling(0.2)
ceiling(1.9)
Output:
ceiling(-1.7)
ceiling(-0.5)
ceiling(0.2)
ceiling(1.9)
-1
-0
1
2
Remarks
This function is usable in const, dash, and autodiff contexts.
When used inside an autodiff block, the gradient associated to ceiling() is 1 instead of 0; this supports discrete policies.