### Table of Contents

# TAN

PET VIC-20 C64 C16 Plus/4 C128 X16

(Defined in *TRIGONO.BAS*)

The `TAN()`

function returns the arctangent of the argument. The inverse function of `TAN()`

is ATN.

## Function header

DECLARE FUNCTION TAN AS FLOAT (x AS FLOAT) SHARED STATIC

Warning

You must include the *TRIGONO.BAS* library in your program to be able to access this function.

## Example

INCLUDE "trigono.bas" PRINT TAN(PI / 4) : REM outputs a number very close to 1, see below note

Note

Trigonometric functions in XC=BASIC were designed to be fast rather than accurate. The result is accurate to 3 to 4 decimal digits (the error range is 0 to 0.0006). Please see this article for details.