Ceil

This reference topic applies to FQL v4. Go to this page for the latest FQL v10 reference topics.

Ceil( value )
Ceil( value )
ceil( value )
Ceil( value )

Description

The Ceil function returns a value that is greater than or equal to the value argument and is equal to the nearest mathematical integer.

Parameters

Parameter Type Definition and Requirements

value

Number

The "ceiling" of this value.

Returns

A Number which is the ceiling of value.

Examples

The following query executes an array of independent Ceil operations and returns each answer in the result array. The result array position matches the position in the execution array.

result, err := client.Query(
	f.Arr{
		f.Ceil(7.0),
		f.Ceil(1.11),
		f.Ceil(2.99),
	})

if err != nil {
	fmt.Fprintln(os.Stderr, err)
} else {
	fmt.Println(result)
}
[7 2 3]
client.query(
  [
    q.Ceil(7.0),
    q.Ceil(1.11),
    q.Ceil(2.99),
  ]
)
.then((ret) => console.log(ret))
.catch((err) => console.error(
  'Error: [%s] %s: %s',
  err.name,
  err.message,
  err.errors()[0].description,
))
[ 7, 2, 3 ]
result = client.query(
  [
    q.ceil(7.0),
    q.ceil(1.11),
    q.ceil(2.99),
  ]
)
print(result)
[7.0, 2.0, 3.0]
[
  Ceil(7.0),
  Ceil(1.11),
  Ceil(2.99),
]
[ 7, 2, 3 ]
Query metrics:
  •    bytesIn:  40

  •   bytesOut:  24

  • computeOps:   1

  •    readOps:   0

  •   writeOps:   0

  •  readBytes:   0

  • writeBytes:   0

  •  queryTime: 4ms

  •    retries:   0

Is this article helpful? 

Tell Fauna how the article can be improved:
Visit Fauna's forums or email docs@fauna.com

Thank you for your feedback!