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