ceil

Function ceil 

Source
pub fn ceil(arg: &Expression) -> Expression
Expand description

Ceiling function (round up to nearest integer)

§Mathematical Definition

ceil(x) = ⌈x⌉ = smallest integer ≥ x

§Arguments

  • arg - Expression to ceil

§Returns

Ceiling expression

§Examples

use mathhook_core::functions::elementary::rounding::ceil;
use mathhook_core::{expr, Expression};

assert_eq!(ceil(&Expression::float(3.2)), Expression::integer(4));
assert_eq!(ceil(&Expression::float(-2.7)), Expression::integer(-2));