MathematicalFunction { private static FunctionResolver floor() { return FunctionDSL.define(BuiltinFunctionName.FLOOR.getName(), FunctionDSL.impl( FunctionDSL.nullMissingHandling(v -> new ExprIntegerValue(Math.floor(v.doubleValue()))), INTEGER, DOUBLE) ); }  static void register(BuiltinFunctionRepository repository);  }
@Test public void floor_null_value() { FunctionExpression floor = dsl.floor(DSL.ref(DOUBLE_TYPE_NULL_VALUE_FIELD, DOUBLE)); assertEquals(INTEGER, floor.type()); assertTrue(floor.valueOf(valueEnv()).isNull()); }
@Test public void floor_missing_value() { FunctionExpression floor = dsl.floor(DSL.ref(DOUBLE_TYPE_MISSING_VALUE_FIELD, DOUBLE)); assertEquals(INTEGER, floor.type()); assertTrue(floor.valueOf(valueEnv()).isMissing()); }