Excel Function : SEC

Download now!

Excel Function : SEC

Category

Math and trigonometry

Description

Returns the secant of an angle

Microsoft Excel Reference Page

https://support.office.com/en-us/article/SEC-function-ff224717-9c87-4170-9b58-d069ced6d5f7

Syntax and Description of the SEC Excel Function

private static final String SEC_SYNTAX = "SEC(number)"; // sec function public static final BuiltinFunction SEC = new BuiltinFunction("SEC", 1, 1) { @Override protected Value evaluate(int[] pos, Value[] args, Calculation calculation) throws EvaluationException { double number = CalculationUtils.getValue(args[0], calculation.getCells()).getNumberValue(); return new NumberValue(1 / Math.cos(number)); } }; //sec function public static final BuiltinFunction SECH = new BuiltinFunction("SECH", 1, 1) {

About SEC Excel Function

SEC(x) returns the secant of an angle x given in radians