MathematicalFunction { private static FunctionResolver acos() { return FunctionDSL.define(BuiltinFunctionName.ACOS.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> v.doubleValue() < -1 || v.doubleValue() > 1 ? ExprNullValue.of() : new ExprDoubleValue(Math.acos(v.doubleValue()))), DOUBLE, type)).collect(Collectors.toList())); }  static void register(BuiltinFunctionRepository repository);  }
@Test public void acos_null_value() { FunctionExpression acos = dsl.acos(DSL.ref(DOUBLE_TYPE_NULL_VALUE_FIELD, DOUBLE)); assertEquals(DOUBLE, acos.type()); assertTrue(acos.valueOf(valueEnv()).isNull()); }
@Test public void acos_missing_value() { FunctionExpression acos = dsl.acos(DSL.ref(DOUBLE_TYPE_MISSING_VALUE_FIELD, DOUBLE)); assertEquals(DOUBLE, acos.type()); assertTrue(acos.valueOf(valueEnv()).isMissing()); }