Ceil

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

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.

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))
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]
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]
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!