FQL v4 will be decommissioned on June 30, 2025. Ensure that you complete your migration from FQL v4 to FQL v10 by that date.

Fauna accounts created after August 21, 2024 must use FQL v10. These accounts will not be able to run FQL v4 queries or access the v4 Dashboard.

For more details, see the v4 EOL announcement and migration guide. Contact support@fauna.com with any questions.

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 )
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.

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]
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]
try
{
    Value result = await client.Query(
        Arr(
            Ceil(7.0),
            Ceil(1.11),
            Ceil(2.99)
        )
    );

    Console.WriteLine(result);
}
catch (Exception e)
{
    Console.WriteLine($"ERROR: {e.Message}");
}
Arr(DoubleV(7), DoubleV(2), DoubleV(3))
System.out.println(
    client.query(
        Arr(
            Ceil(Value(7.0)),
            Ceil(Value(1.11)),
            Ceil(Value(2.99))
        )
    ).get());
[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!