@Test public void atan_null_value() { FunctionExpression atan = dsl.atan(DSL.ref(DOUBLE_TYPE_NULL_VALUE_FIELD, DOUBLE)); assertEquals(DOUBLE, atan.type()); assertTrue(atan.valueOf(valueEnv()).isNull()); atan = dsl.atan(DSL.ref(DOUBLE_TYPE_NULL_VALUE_FIELD, DOUBLE), DSL.literal(1)); assertEquals(DOUBLE, atan.type()); assertTrue(atan.valueOf(valueEnv()).isNull()); atan = dsl.atan(DSL.literal(1), DSL.ref(DOUBLE_TYPE_NULL_VALUE_FIELD, DOUBLE)); assertEquals(DOUBLE, atan.type()); assertTrue(atan.valueOf(valueEnv()).isNull()); atan = dsl.atan(DSL.ref(DOUBLE_TYPE_NULL_VALUE_FIELD, DOUBLE), DSL.ref(DOUBLE_TYPE_NULL_VALUE_FIELD, DOUBLE)); assertEquals(DOUBLE, atan.type()); assertTrue(atan.valueOf(valueEnv()).isNull()); }
private static FunctionResolver atan() { ImmutableList.Builder<SerializableFunction<FunctionName, Pair<FunctionSignature, FunctionBuilder>>> builder = new ImmutableList.Builder<>(); for (ExprType type : ExprCoreType.numberTypes()) { builder.add(FunctionDSL.impl(FunctionDSL .nullMissingHandling(x -> new ExprDoubleValue(Math.atan(x.doubleValue()))), type, DOUBLE)); builder.add(FunctionDSL.impl(FunctionDSL .nullMissingHandling((y, x) -> new ExprDoubleValue(Math.atan2(y.doubleValue(), x.doubleValue()))), DOUBLE, type, type)); } return FunctionDSL.define(BuiltinFunctionName.ATAN.getName(), builder.build()); }
MathematicalFunction { private static FunctionResolver atan() { ImmutableList.Builder<SerializableFunction<FunctionName, Pair<FunctionSignature, FunctionBuilder>>> builder = new ImmutableList.Builder<>(); for (ExprType type : ExprCoreType.numberTypes()) { builder.add(FunctionDSL.impl(FunctionDSL .nullMissingHandling(x -> new ExprDoubleValue(Math.atan(x.doubleValue()))), type, DOUBLE)); builder.add(FunctionDSL.impl(FunctionDSL .nullMissingHandling((y, x) -> new ExprDoubleValue(Math.atan2(y.doubleValue(), x.doubleValue()))), DOUBLE, type, type)); } return FunctionDSL.define(BuiltinFunctionName.ATAN.getName(), builder.build()); } }
MathematicalFunction { private static FunctionResolver atan() { ImmutableList.Builder<SerializableFunction<FunctionName, Pair<FunctionSignature, FunctionBuilder>>> builder = new ImmutableList.Builder<>(); for (ExprType type : ExprCoreType.numberTypes()) { builder.add(FunctionDSL.impl(FunctionDSL .nullMissingHandling(x -> new ExprDoubleValue(Math.atan(x.doubleValue()))), type, DOUBLE)); builder.add(FunctionDSL.impl(FunctionDSL .nullMissingHandling((y, x) -> new ExprDoubleValue(Math.atan2(y.doubleValue(), x.doubleValue()))), DOUBLE, type, type)); } return FunctionDSL.define(BuiltinFunctionName.ATAN.getName(), builder.build()); }  }
MathematicalFunction { private static FunctionResolver atan() { ImmutableList.Builder<SerializableFunction<FunctionName, Pair<FunctionSignature, FunctionBuilder>>> builder = new ImmutableList.Builder<>(); for (ExprType type : ExprCoreType.numberTypes()) { builder.add(FunctionDSL.impl(FunctionDSL .nullMissingHandling(x -> new ExprDoubleValue(Math.atan(x.doubleValue()))), type, DOUBLE)); builder.add(FunctionDSL.impl(FunctionDSL .nullMissingHandling((y, x) -> new ExprDoubleValue(Math.atan2(y.doubleValue(), x.doubleValue()))), DOUBLE, type, type)); } return FunctionDSL.define(BuiltinFunctionName.ATAN.getName(), builder.build()); }  static void register(BuiltinFunctionRepository repository); }
MathematicalFunction { private static FunctionResolver atan() { ImmutableList.Builder<SerializableFunction<FunctionName, Pair<FunctionSignature, FunctionBuilder>>> builder = new ImmutableList.Builder<>(); for (ExprType type : ExprCoreType.numberTypes()) { builder.add(FunctionDSL.impl(FunctionDSL .nullMissingHandling(x -> new ExprDoubleValue(Math.atan(x.doubleValue()))), type, DOUBLE)); builder.add(FunctionDSL.impl(FunctionDSL .nullMissingHandling((y, x) -> new ExprDoubleValue(Math.atan2(y.doubleValue(), x.doubleValue()))), DOUBLE, type, type)); } return FunctionDSL.define(BuiltinFunctionName.ATAN.getName(), builder.build()); }  static void register(BuiltinFunctionRepository repository);  }