Select Page

In this article, I’ll explain the Oracle TAN function, what it is, and show you some examples.

## Purpose of the Oracle TAN Function

The purpose of the Oracle TAN function is to calculate the tangent of a number.

The tangent is ratio of the length of the side opposite the angle to the length of the side adjacent, which you can read more about here.

It’s one of three similar functions, with the other two being COS and SIN.

## Syntax

The syntax of the TAN function is:

TAN (number)

## Parameters

The parameters of the TAN function are:

• number (mandatory): The number used to calculate the tangent.
The number parameter can be any numeric data type. If the parameter’s data type is a BINARY_FLOAT, the a BINARY_DOUBLE is returned. Otherwise, the return type is the same as the type of the parameter.

## Examples of the TAN Function

Here are some examples of the TAN function, which may help explain how it is used.

### Example 1

SELECT TAN(4) AS tan_value
FROM dual;

Result:

 TAN_VALUE 1.157821282

### Example 2

SELECT TAN(19) AS tan_value
FROM dual;

Result:

 TAN_VALUE 0.1515894706

### Example 3

SELECT TAN(1.2) AS tan_value
FROM dual;

Result:

 TAN_VALUE 2.572151622

### Similar Functions

Some functions which are similar to the TAN function are:

• COS: Returns the cosine of a number.
• SIN: Returns the sine 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!

x