floor

Function floor 

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

Floor function (round down to nearest integer)

§Mathematical Definition

floor(x) = ⌊x⌋ = greatest integer ≤ x

§Arguments

  • arg - Expression to floor

§Returns

Floor expression

§Examples

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

assert_eq!(floor(&Expression::float(3.7)), Expression::integer(3));
assert_eq!(floor(&Expression::float(-2.3)), Expression::integer(-3));