Purpose of the Oracle COS Function
The COS function will return the cosine of a number.
If your knowledge of cosine is a bit rusty (like mine), then you might find this definition helpful.
The syntax of the COS function is:
The parameters of the COS function are:
- number (mandatory): This is the number to convert into a cosine.
The number can be any numeric data type. The return value is in the same data type as the specified data type, unless the specified data type is BINARY_FLOAT. In that case, the return type is BINARY_DOUBLE.
Examples of the COS Function
Here are some examples of the COS function. The three examples are quite similar, as the syntax is simple, but they use different numbers as input.
SELECT COS(3.141) AS cos_value FROM dual;
SELECT COS(1) AS cos_value FROM dual;
SELECT COS(5.2) AS cos_value FROM dual;
Some functions which are similar to the COS function are:
- SIN: Returns the sine of a number.
- TAN: Returns the tangent of a number.
- COSH: Returns the hyperbolic cosine of a number.
- SINH: Returns the hyperbolic sine of a number.
- TANH: Returns the hyperbolic tangent of a number.
If you want to know more about SQL functions, you can find a full list of Oracle SQL functions here.
Lastly, if you enjoy the information and career advice I’ve been providing, sign up to my newsletter below to stay up-to-date on my articles. You’ll also receive a fantastic bonus. Thanks!