1TAN(3)                     Linux Programmer's Manual                    TAN(3)
2
3
4

NAME

6       tan, tanf, tanl - tangent function
7

SYNOPSIS

9       #include <math.h>
10
11       double tan(double x);
12       float tanf(float x);
13       long double tanl(long double x);
14
15       Link with -lm.
16
17   Feature Test Macro Requirements for glibc (see feature_test_macros(7)):
18
19       tanf(), tanl():
20           _ISOC99_SOURCE || _POSIX_C_SOURCE >= 200112L
21               || /* Since glibc 2.19: */ _DEFAULT_SOURCE
22               || /* Glibc <= 2.19: */ _BSD_SOURCE || _SVID_SOURCE
23

DESCRIPTION

25       These functions return the tangent of x, where x is given in radians.
26

RETURN VALUE

28       On success, these functions return the tangent of x.
29
30       If x is a NaN, a NaN is returned.
31
32       If  x is positive infinity or negative infinity, a domain error occurs,
33       and a NaN is returned.
34
35       If the correct result would overflow, a range  error  occurs,  and  the
36       functions  return HUGE_VAL, HUGE_VALF, or HUGE_VALL, respectively, with
37       the mathematically correct sign.
38

ERRORS

40       See math_error(7) for information on how to determine whether an  error
41       has occurred when calling these functions.
42
43       The following errors can occur:
44
45       Domain error: x is an infinity
46              errno  is set to EDOM (but see BUGS).  An invalid floating-point
47              exception (FE_INVALID) is raised.
48
49       Range error: result overflow
50              An overflow floating-point exception (FE_OVERFLOW) is raised.
51

ATTRIBUTES

53       For an  explanation  of  the  terms  used  in  this  section,  see  at‐
54       tributes(7).
55
56       ┌────────────────────────────────────────────┬───────────────┬─────────┐
57Interface                                   Attribute     Value   
58       ├────────────────────────────────────────────┼───────────────┼─────────┤
59tan(), tanf(), tanl()                       │ Thread safety │ MT-Safe │
60       └────────────────────────────────────────────┴───────────────┴─────────┘
61

CONFORMING TO

63       C99, POSIX.1-2001, POSIX.1-2008.
64
65       The variant returning double also conforms to SVr4, 4.3BSD, C89.
66

BUGS

68       Before version 2.10, the glibc implementation did not set errno to EDOM
69       when a domain error occurred.
70

SEE ALSO

72       acos(3), asin(3), atan(3), atan2(3), cos(3), ctan(3), sin(3)
73

COLOPHON

75       This page is part of release 5.12 of the Linux  man-pages  project.   A
76       description  of  the project, information about reporting bugs, and the
77       latest    version    of    this    page,    can     be     found     at
78       https://www.kernel.org/doc/man-pages/.
79
80
81
82                                  2021-03-22                            TAN(3)
Impressum