diff --git a/src/data_type/function.rs b/src/data_type/function.rs index 0a20d500..1306d199 100644 --- a/src/data_type/function.rs +++ b/src/data_type/function.rs @@ -1813,9 +1813,11 @@ pub fn floor() -> impl Function { } // Round function +// monotonic for the 1st variable but not for the second => Pointwise pub fn round() -> impl Function { - PartitionnedMonotonic::bivariate( + Pointwise::bivariate( (data_type::Float::default(), data_type::Integer::default()), + data_type::Float::default(), |a, b| { let multiplier = 10.0_f64.powi(b as i32); (a * multiplier).round() / multiplier @@ -1824,9 +1826,11 @@ pub fn round() -> impl Function { } // Trunc function +// monotonic for the 1st variable but not for the second (eg: when the 2nd arg is negative )=> Pointwise pub fn trunc() -> impl Function { - PartitionnedMonotonic::bivariate( + Pointwise::bivariate( (data_type::Float::default(), data_type::Integer::default()), + data_type::Float::default(), |a, b| { let multiplier = 10.0_f64.powi(b as i32); (a * multiplier).trunc() / multiplier @@ -1834,14 +1838,6 @@ pub fn trunc() -> impl Function { ) } -// Sign function -pub fn sign() -> impl Function { - PartitionnedMonotonic::univariate( - data_type::Float::default(), - |a| a.signum() - ) -} - /* Aggregation functions */