@Test public void cot_missing_value() { FunctionExpression cot = dsl.cot(DSL.ref(DOUBLE_TYPE_MISSING_VALUE_FIELD, DOUBLE)); assertEquals(DOUBLE, cot.type()); assertTrue(cot.valueOf(valueEnv()).isMissing()); }
private static FunctionResolver cot() { return FunctionDSL.define(BuiltinFunctionName.COT.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> { Double value = v.doubleValue(); if (value == 0) { throw new ArithmeticException( String.format("Out of range value for cot(%s)", value)); } return new ExprDoubleValue(1 / Math.tan(value)); }), DOUBLE, type)).collect(Collectors.toList())); }
MathematicalFunction { private static FunctionResolver cot() { return FunctionDSL.define(BuiltinFunctionName.COT.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> { Double value = v.doubleValue(); if (value == 0) { throw new ArithmeticException( String.format("Out of range value for cot(%s)", value)); } return new ExprDoubleValue(1 / Math.tan(value)); }), DOUBLE, type)).collect(Collectors.toList())); } }
MathematicalFunction { private static FunctionResolver cot() { return FunctionDSL.define(BuiltinFunctionName.COT.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> { Double value = v.doubleValue(); if (value == 0) { throw new ArithmeticException( String.format("Out of range value for cot(%s)", value)); } return new ExprDoubleValue(1 / Math.tan(value)); }), DOUBLE, type)).collect(Collectors.toList())); }  }
MathematicalFunction { private static FunctionResolver cot() { return FunctionDSL.define(BuiltinFunctionName.COT.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> { Double value = v.doubleValue(); if (value == 0) { throw new ArithmeticException( String.format("Out of range value for cot(%s)", value)); } return new ExprDoubleValue(1 / Math.tan(value)); }), DOUBLE, type)).collect(Collectors.toList())); }  static void register(BuiltinFunctionRepository repository); }
MathematicalFunction { private static FunctionResolver cot() { return FunctionDSL.define(BuiltinFunctionName.COT.getName(), ExprCoreType.numberTypes().stream() .map(type -> FunctionDSL.impl(FunctionDSL.nullMissingHandling( v -> { Double value = v.doubleValue(); if (value == 0) { throw new ArithmeticException( String.format("Out of range value for cot(%s)", value)); } return new ExprDoubleValue(1 / Math.tan(value)); }), DOUBLE, type)).collect(Collectors.toList())); }  static void register(BuiltinFunctionRepository repository);  }