ceiling

ceiling, function

def const dash autodiff pure ceiling(a: number): number

Returns the smallest integer greater than or equal to a.

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.

See also

User Contributed Notes
0 notes + add a note