Skip to content

Latest commit

 

History

History
43 lines (31 loc) · 782 Bytes

File metadata and controls

43 lines (31 loc) · 782 Bytes
layout language permalink command related_commands
api-command
Python
api/python/ceil/
ceil
floor round
floor/
round/

Command syntax

{% apibody %} r.ceil(number) → number number.ceil() → number {% endapibody %}

Description

Rounds the given value up, returning the smallest integer value greater than or equal to the given value (the value's ceiling).

Example: Return the ceiling of 12.345.

> r.ceil(12.345).run(conn)

13.0

The ceil command can also be chained after an expression.

Example: Return the ceiling of -12.345.

> r.expr(-12.345).ceil().run(conn)

-12.0

Example: Return Iron Man's weight, rounded up with ceil.

r.table('superheroes').get('ironman')['weight'].ceil().run(conn)