MathematicalFunction { private static FunctionResolver tan() { return FunctionDSL.define(BuiltinFunctionName.TAN.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> new ExprDoubleValue(Math.tan(v.doubleValue()))), DOUBLE, type)).collect(Collectors.toList())); }  static void register(BuiltinFunctionRepository repository);  }
@Test public void tan_null_value() { FunctionExpression tan = dsl.tan(DSL.ref(DOUBLE_TYPE_NULL_VALUE_FIELD, DOUBLE)); assertEquals(DOUBLE, tan.type()); assertTrue(tan.valueOf(valueEnv()).isNull()); }
@Test public void tan_missing_value() { FunctionExpression tan = dsl.tan(DSL.ref(DOUBLE_TYPE_MISSING_VALUE_FIELD, DOUBLE)); assertEquals(DOUBLE, tan.type()); assertTrue(tan.valueOf(valueEnv()).isMissing()); }