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

Argument 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', err))
[ 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]
try {
  println(Await.result(
  client.query(
    Arr(
      Ceil(7.0),
      Ceil(1.11),
      Ceil(2.99)
    )
  ),
  5.seconds
))} catch {
  case unknown: Throwable => println("Error: " + unknown.getMessage())
}
[7.0, 2.0, 3.0]

Was this article helpful?

We're sorry to hear that.
Tell us how we can improve!
Visit Fauna's Discourse forums or email docs@fauna.com

Thank you for your feedback!